Well no not really. Only the 2nd factor is the code, the 1st factor is your appleid password.
If someone found out my AppleId password, and stole or had access to my laptop. They could try signing in, and the laptop would display the 2FA code on the very same laptop they are using, which is a security flaw. Doesn't make sense. It should only show the 2FA code on OTHER trusted devices, not the device you are signing into.
Has noone experienced this before?