Maybe this is unrelated, but sometimes 2FA doesn't work if your clock isn't properly sync.
I had the same problem with 2FA caused by CMOS battery. But since I already replaced it with the new one, the problem is gone now. I used to change my clock everytime I want to login to a site that I enable the 2FA feature and that makes me crazy. Frankly, clock is the most common problem when someone enabled 2fa security.