Steps to Reproduce:
Switch to third person view in any gamemode that's not spectator;
Get near any of the blocks in the list and observe:
List of affected blocks (may be incomplete):
All walls;All fences (when shaped as corners);
All fence gates;All stairs;
All slabs;All carpets (when swimming);All heads;Bell;Conduit;End rod;Lightning rod;All pressure plates;Daylight sensor;Extended piston arm
Notes: This also occurs when inside of full blocks, but in those cases you'd be suffocating in them.
Related issues
is duplicated by
Attachments
Comments

Partially fixed in 1.20.0.23 Preview. Still affects stairs and extended pistons.

I can't reproduce this in 1.20.0 or 1.20.10.21.
Are you sure? This is easily reproducible with stairs, extended piston arms and fences shaped as corners.

After further testing, I was able to reproduce the issue. The player needs to be standing in the same space as the block, not near it.

Affects in 1.20.1 & 1.20.20.20 Preview

Also affects 1.21.0.20.

This occurs for end rods, carpets, fences, slabs, fence gates, stairs, daylight sensors, cauldrons, mob heads, and lecterns when in a mincart and passing through them.

Affects 1.21.81