You can actually get unstuck from situations like those if you open your inventory, because it causes a small amount of lag. It doesn’t work on all of them, but it works for a large sum of them.
What’s happening is you are colliding with one (or more) surfaces repeatedly with rapid succession. This often happens when you get wedged between a crack, or getting pushed up against a surface by a booster. (Like Nimbus ramps) This will get you stuck because the collision sends you back into the other surface over and over again, repeatedly changing your momentum and not allowing you to move. To get unstuck, you cause lag (through inventory or content or otherwise) to disable the collisions enough for a few frames so you can pick up speed to get out of it. In this case, you are getting accelerated into the star, then bouncing off of it every frame, resulting in the shaky motion that keeps you stuck. Due to the momentum change you get based on where you hit slanted stars from, it will gravitate you towards the middle of said star. The only way to get unstuck is to cause the game to freeze so it forgets about launching you at the star for a short time.
This happens way more easily with higher and higher framerates, increasing linearily.