Have you created the buttons using the secure frame system ? That will allow limited functionality while in combat.
Just in case you haven't looked at that aspect of this then this page may help you. As well as some posts on this site ..
https://wow.gamepedia.com/SecureTemplates
As to why the Character button isn't working could be due to the fact that you are not allowed ( I think ) to switch out your armour and weapons during combat. I vaguely recall seeing a message when I tried opening the frame myself ( using the mouse rather than script ).