Take MarkT's advice to heart, learn how to properly draw schematics. Often, just redrawing it will cause the fault to jump out at you.http://opencircuitdesign.com/xcircuit/goodschem/goodschem.htmlYour basic problem is that you are trying to switch the low side of the battery to select between sources that have a common ground (the 32V power supply). And PNP are absolutely the wrong transistors to use in a low side switch.You have enough charger voltage headroom to simply connect the two CC and CV circuits in series. Put the constant current first, then constant voltage. Then you have a current limited, voltage limited charger. It will never put out more current than the setpoint, and never put out more voltage than the setpoint.