The Screen Time passcode is designed to restrict access to certain features and settings. This includes the ability to sign out of an Apple ID. To resolve this, disable the Screen Time passcode.