This happened to me a month ago. I was at the cinema and got multiple 2FA notifications on my phone, all of which I clicked 'Deny' on. When I got home, my mac was locked asking for a code and there was no way for me to bypass it. I had to take it to an apple store to have it reset - quite a struggle for a 27" iMac. I explained I had 2FA enabled and tapped Deny on all the popups. (My 2 phones, and my iPad, all said they were locked, but putting in my passcode unlocked them fortunately).