I cannot exactly tell in which version this issue was introduced because it sometimes happened in snapshots like 24w37a or 24w38a, sometimes not. In the release candidate however, I can consistently reproduce it.
Steps to reproduce (video is attached):
Place a magma block underwater so it makes a bubble column.
Shoot at the magma block with a trident or bow from a certain angle so the projectile actually lands on top of the magma block.
❌ Once the projectile hits the magma block, it glitches, changing rotation several times.
Edit: A related behavior occurs in the case of soul sand blocks underwater: If arrows are shot into a soul sand block from above, they first leave the soul sand block and then come back and stay there.
Can confirm, relates to MC-277658