How to reproduce
Set your own attribute generic.step_height with a positive integer and generic.gravity with 0, for example, execute these commands on the chat:
/attribute @s minecraft:generic.step_height base set 6
/attribute @s minecraft:generic.gravity base set 0
Place a block in the space from the number of your current attribute generic.step_height x 1 blocks below to 1.5 blocks above it.
Try to go over that edge when there is a block where you are standing by moving while sneaking. (Then this happens)
Change location and place a half block (up) generic.step_height x 1 - 1 blocks down.
Again try to go over that edge when there is a block where you are standing by moving while sneaking. (Then this not happens)
Execute this command on the chat:
/attribute @s minecraft:generic.step_height base set 11
Place a block in the space from 10 block below to 1.5 blocks above it.
Again try action in 3. (Then this happens again)
Repeat the actions in 1.
Execute this command on the chat:
/attribute @s minecraft:generic.scale base set 0.5
Place a block generic.step_height x 1 - 1 block down.
Again try action in 3. (Then this not happens)
I think it is related to MC-267381, MC-270712.