How are you generating the masks? I think what’s happening is you’re using auto-trace or similar and each mask is then acting as if it’s brand new and has it’s own origin points. When animating together, you’re getting the points not lining up as you’d expect, so they are flipping the mask shapes.
If that’s the case, you need to right-click on a common point for each mask keyframe and choose: Mask Shape & Path > Set First Vertex.
I made a video a while back about morphing masks:
Some contents or functionalities here are not available due to your cookie preferences!