I have been having this issue consistently for at least a month or so. I have an iPhone 14 Pro Max and I am with T-Mobile. I have been with them for years but just got this phone mid-May. Before that I had an iPhone 11. I think I only heard the knocking sound once or twice with that phone but I hear at lot with this one and usually only when I’m talking to my fiancé who has an iPhone 12 with AT&T. I heard it once when I was leaving my aunt a voicemail (she has an iPhone).
We did some testing and figured out that it only happens when he has me on speakerphone (same as jena25) and it usually stops when he starts talking. He doesn’t hear it but after I recorded the sounds (it comes in different volumes and pitches), he did remember hearing the higher-pitched sound once but thought I was doing something. When I first would hear it, that’s exactly what I thought, that he was just doing stuff in the background or it was his fan. Now that he and I are talking it through, I heard it a lot on the iPhone 11, but it was only at night. We stay on the phone all night long and while he was sleeping, I would hear it but I thought it was his heater or fan.