Was the message “Use this iPhone to reset your Apple ID password” what was shown?

That can mean your Apple ID password has been compromised:
See this explanation: https://mashable.com/article/scary-iphone-password-notification-hack
I’d change the Apple ID password:
If you think your Apple ID has been compromised - Apple Support
I’d also review and set or re-set the other trusted devices and trusted telephone numbers, and recovery contacts, and legacy contacts as appropriate, while fixing that Apple ID password, too.
If you’re re-using passwords, that can end badly just as soon as one copy of the duplicate password is breached somewhere. I’d suggest changing all reused passwords to new and unique passwords, lest one breach exposes all.