Hi BattieOS,
It sounds like you're having an issue with two-factor authentication. We recommend testing the steps in the guide here: Set up iCloud Passwords on your Windows computer
If you have an iPhone, test obtaining the code from the settings using the steps found below and in the article here: Get a verification code and sign in with two-factor authentication - Apple Support
"Get a code from Settings on your trusted device
If you can’t receive a verification code on your trusted devices automatically, you can get one from Settings, even if your device is offline.
From your iPhone, iPad, or iPod touch
If your device is online:
- Go to Settings > [your name].
- Tap Password & Security > Get Verification Code.

If your device is offline:
- Go to Settings > [your name].
- Tap Password & Security.
- A message says "Account Details Unavailable." Tap Get Verification Code."
There are additional steps to obtain the code on other devices as well. As you're able to obtain a code when signing in on the iCloud website, ensure your iCloud for Windows and OS is fully updated.
Set up and use iCloud for Windows - Apple Support
If the issue continues, reach out to Apple Support to further assist.
Contact - Official Apple Support
Contact Apple for support and service - Apple Support
Best.