Affects 1.21.9, and this issue was set to resolved. This is not how sneaking works, as when set to toggle, after closing a screen the player will start sneaking again.
Still affects 25w33a. Can’t find a GUI that doesn’t cause this problem, including chat, pausing, F3+F4 etc.
Yes, mouse button used as sprint key. Is there an open issue for this bug?