Is your iPhone using IOS 13.4 or later or Catalina 10.15.4 or later? See the Apple Support article(s) below. Link to contact Apple Support at the end of the article.
If necessary, you will need to restore the device to factory settings. Do not restore from a backup made when the Screen Time code was active.
Some things you can try. Do you have access to another WiFi network where you can try? That has worked for several people.
Try a restart.
Restart your iPhone, iPad, or iPod touch *
Try a forced restart. See the section towards the end of the article.
Reset Device. -
If necessary
Hard reset. -
Do a backup and try a factory reset. Then restore from the backup.
Restore - If you see an error when you update or restore your iPhone, iPad, or iPod. *