Addition to this bug:
It happens in a realm when you’re exploring and you reach in area in the realm, I don’t know why but I have this one area that I entered and I froze in place and nothing worked. So, I closed Minecraft and opened it again to realize I couldn’t join realms. So, I reverted to a backup from before I entered that area and it works. However, I went back to that same area and it happened again. So, for now I’m avoiding the area. But I think it maybe could be world corruption or something of the sort due to my world on the realm having a 500mb world size.
This bug is due to the movement button’s overlapping the hot bar. If you lower your GUI to -1 or -2, or you lower your button size this problem will be completely fixed.
This only happens in 1.19 because the update caused the movement buttons on touch screen to move slightly to the right.
I have this same exact problem. And it happened to my friend, but he randomly got it back in his inventory 5 minutes later. But then it happened to me, and the elytra never came back.
This happens to me too