This happens to me too! It always has with ANY hardware keyboard.
When opening the chat using the / key
When opening the chat using the ENTER key
It is infuriating. The only workaround is to open the chat using: [ENTER] [SPACE] – then you can type a command or chat and have it work correctly. But it is so broken. It's been this way for at least 10 months, probably more.
I'm running 1.21 on a Galaxy Tab S7 but I'm pretty sure I've seen this on every Android tablet I've tried it on.
I also was able to work around this by using Gboard, but I don't want to use Gboard. What virtual keyboard I use should have no bearing on how my PHYSICAL keyboard performs in Minecraft. When the bug is manifesting, space works fine after all – as long as I'm not trying to use it to jump.
You can also work around this problem by retraining yourself completely to use a different jump key – since if you use say, "B" to jump, this bug doesn't occur. Needless to say that is a terrible solution.