Shame is the feeling you get when you commit an action that is outside your own standards. Trust me
everyone feels this at many points throughout their lives. However feeling shame about things you do due to mental illness is not quite the same. I no longer feel shame if do something odd in the presence of others unless it caused by me skipping my meds. However if I do something odd at any time I still need to think about what I said/did in effort to train myself not to do it again. Seems like I'm always training myself about one thing or another.
Shame is just a reminder that you have a good set of standards and that all you did was take a quick step outside of those standards. So just learn from it, apologize if required and carry on.