This is apparently by design, in order to address a security vulnerability: https://imazing.com/blog/ios-backup-passcode-prompt
But surely Apple could fix this more properly, however I guess they don't care to support people who make limited use of iCloud.