If you open system preferences > iCloud and uncheck the box of photos ( the box will get unchecked you have to tap / click on the box at least 2 -3 times , to check the box just click on empty photos box it will prompt to enter admin password and never Apple ID password .
Either login keychain is corrupted or system preferences not responding ( sometimes it is preferred to enter in user library and from preferences folder drag and drop com.apple.systempreferences.plist to the desktop restart the Mac again and open the browser ) the .plist will again be recreated .
Run safe mode https://support.apple.com/en-in/guide/mac-help/mh21245/mac
See the thread https://discussions.apple.com/thread/251937924
Avoid using anti virus / third party apps / softwares in Mac , if they are in applications , go to finder > applications , right click on them and move to trash , restart the Mac and empty the trash .
Create a new admin account in users and groups and check the issue persists https://support.apple.com/en-in/guide/mac-help/mtusr001/mac
This article is just for information if login password is incorrect https://support.apple.com/en-in/guide/mac-help/mhosxlogo1438/10.15/mac/10.15