It looks like you're on the right track — Firefox is running under xwayland rather than Wayland. I had this problem with one of my devices too, but it was fixed by setting the two environment variables you mention and possibly a third, MOZ_USE_WAYLAND.
I'd start by confirming those variables work by executing Firefox with them one-shot:
MOZ_ENABLE_WAYLAND=1 MOZ_USE_XINPUT2=1 MOZ_USE_WAYLAND=1 firefox
If that works, stick them in /etc/environment or /etc/profile (or ~/.profile), restart your session, confirm they're set (eg, echo $MOZ_ENABLE_WAYLAND) and you should be good to go.
If they don't work, I'd start exploring what's preventing Firefox from running natively under Wayland.