At least you can restore it. Imagine all your devices are lost in a massive fire, is there a way to get back your apple account?
It is definitely a good idea to plan in advance and set up a recovery contact: https://support.apple.com/en-us/102641
And that link is to recovery contacts, not codes. If you’re willing to trust one person you can get back into your Apple account after a disaster.