Hello Welltravel2,
Welcome to Apple Support Communities. We will not be able to tell for sure if it was legitimate diagnostic request or not as we can't see the message showing on your iPhone but we can provide some guidance.
If you were working with Apple Support via chat or phone to troubleshoot an issue with your iPhone, they have the means to initiate a diagnostic test to gather information about the device hardware. This will let them know if it is a software or hardware issue.
If you received this message without being in contact with Apple Support troubleshooting an issue with your iPhone, it could be:
1- A scam pop up, and you should not open it or click any links in this message
2- Could be someone else troubleshooting their device with Apple, and accidentally provided a wrong serial number that matches yours, so when the Apple advisor initiated the diagnostic process, you got this pop up. In this case, you may ignore this message as well.
In the meantime, if you believe your account is compromised, you can follow the steps in the following link:
If you think your Apple ID has been compromised
We hope this information is useful. Kind regards.