I know that this is old, but no answer has been posted, so I'm posting my guess in case it might help anyone.
I expect that this is from the sonar feature for sleep tracking. On my LG G8 ThinQ, when I went to configure sonar, the volume was set quite low, and it worked fine. When I went to configure someone's Google Pixel 3, the sonar test made high-pitched siren-like sounds. The volume for sonar was at maximum, and very high or very low pitches played too loudly can cause audio distortion, and that's exactly what sonar was doing: playing high pitches at maximum volume. I manually brought down the sonar volume setting to maybe 20%, left and reëntered to make sure that the siren sound didn't happen, tested it to make sure that sonar was detecting something, and we haven't heard the sound since.
My guess is that your sleep tracking was on, set to sonar, with sonar volume too high, and it started after a short delay to determine if you were sleeping, and disabled sonar when you accessed your phone because using your phone is a pretty clear indication that you're not asleep. Going into sonar settings or changing sonar to accelerometer instead might fix it.
I am basing this all off of one case with no retesting, so I apologise if I'm wrong and have wasted your time, but figured that I'd toss the idea out there.