Actually, this can happen with any wall, if Tails happens to be juuuuuuuuuuuust above the wall (or below it? I'm not sure now), the player he has carried will go into the wall for whatever reason...good thing that the player can easily escape though.
Well, Tails seems to be buggy, but he was like that in Sonic 3 too...