This has actually happened to me too. I assume this happens because the floating thing despawned without unreferencing Mario, while also causing another one of those to spawn using the same spot in memory, making Mario essentially teleport to that new position.