It seems that changing the key bind for open/close inventory to mouse 4 or 5 buttons makes it to where you can open inventory but cannot close it with the same button. I am forced to press escape instead. It appears that keyboard keys work as intended, but the mouse buttons make it to where you can open inventory but not close it.
Related issues
Comments

Thank you for your report!
We are tracking this issue in MC-156810, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote or provide any additional information to the main ticket, it would be appreciated.
If you havenβt already, please make use of the search feature to see whether an issue has already been reported.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support (Technical Issues) β π§ Microsoft Support (Account Issues)
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki