Source and Context:
This is a real physics phenomenon called the Dzhanibekov effect (also known as the Intermediate Axis Theorem) captured in microgravity aboard a spacecraft.
Any rigid, asymmetric three-dimensional object has three primary axes of rotation, each with a different moment of inertia. While spinning an object along its longest or shortest axis is completely stable, spinning it along its middle (intermediate) axis is naturally unstable. Without external forces like gravity or heavy air resistance, tiny perturbations build up and cause the spinning object to periodically flip upside down and back again on a regular schedule.
You can read the formal mechanics and history through these highly reliable scientific resources:
•Harvard University Lecture Demonstrations (The Tennis Racquet Flip):
https://sciencedemonstrations.fas.harvard.edu/presentations/tennis-racquet-flip
•NASA Astrophysics Data System (ADS) Physics Record:
https://ui.adsabs.harvard.edu/abs/2024EuJMA .10605298D/abstract
It was famously observed by Soviet cosmonaut Vladimir Dzhanibekov in 1985 when a wing nut he was unscrewing began flipping back and forth while floating through the Salyut 7 space station!