If you look closely, there's a single frame of Sonic standing before he's crushed. My theory is that, because Sonic is curled up in a ball when jumping, his hitbox is small enough to fit in the gap, but when he is, the game makes him land and stand, which results in him getting crushed. You have probably figured this out, though.