Hard to say but maybe bloat/swim bladder issues. Please post ur water parameters, tank info, tankmates, water change schedule, and diet. Add a pic or video. Would lower the water level so it can stay upright and add some Epsom salt 1 tbsp per 5g. Add some kanamycin. Start with that for now. I assume because of the lack of balance. Hope it gets better.
Reminds me of their behavior when in shock from going from high to low oxygen water or from a spike in pH or hardness, temp, etc.
You and your fish could benefit if you followed the guidelines for asking health-related questions posted in stickies in the Diseases forum and the General Aquaria forum.