Your model is quite convoluted, not sure what the problem is. I don't think you need two controllers to start with. You can add those if you need different performance for charge / discharge. Also, I would suggest to use MOSFETs in a totem-pole configuration instead of IGBTs.
Your problem can be solved way simpler. See attached minimum working model.
Cheers
Falk