In an effort to control your air, you may be using the larynx and vocal cords. I used to do this also as a high school player (I am still at that level after putting the horn down many years ago). Back then, I would complain about my throat hurting and I would also tighten my neck muscles when playing high C.
When I recently picked the horn again, I planned to play better than my high school days. Since I didn’t practice much back then, I thought it just a matter of putting in the work. After purchasing method books, I was positive I would become the player I should have been. But then, I began to have a tight throat after playing just like 40 years ago. Playing trumpet would affect my voice making it gravelly sounding when talking. I would try clearing my throat which made it worse.
Then I found Mystery to Mastery and stopped all the Misery to Madness.
I would say you are manipulating airflow using your throat. Doing this closes off a free airflow and may totally close off your airway when trying to play those high notes. It is just like Greg demonstrated when he did “The Sound Equation” video. You are describing the Valsalva maneuver. This is dangerous and you need to stop it.
Saying to stop it does not make the habit go away. Go back to the beginning, the introduction. Follow the steps and repeat the process over and over. It is a matter retraining your brain.