Firstly, I’d like to start off by saying I don’t know the answer to your question.
I’m gonna qualify what I say next as I’ve been down this particular path before, it took a couple of years for me to feel better, so I’ll share. Feel free to write it off as “internet nonsense” and no guarantee or warranty implied
Your fears aren’t silly.
I think you will have an upper gastroscopy (through the mouth) - the procedure itself isn’t a walk in the park but it’s nowhere as bad as people make out. I didn’t have any sedative, apart from the spray stuff in the throat. I’d compare the experience to a vomiting session when having the flu, except when the procedure is finished (five minutes tops) you feel absolutely fine again.
For me, they didn’t find anything, all in good physical health down there. This is common. In the follow-up session, the doctor told me that it was chicken and egg typically if stomach issues are caused by mental health. At the time, I didn’t think I was under any stress and thought things were well, but in hindsight I think I was struggling with some things that I was demanding of myself. He told me “don’t let it ruin your life” and sent me on my way.
I was furious! I thought, what a lazy arse, he hasn’t put enough effort into finding my problems and I’m vomiting and having diarrhoea, how can he just let this go!
Five years later this is probably one of the best advices anyone has ever given me. I just ignored it and shifted focus onto something else (travelling, new job, move somewhere…) to get out of my head. It literally resolved overnight (after a few years since seeing the doctor) and hasn’t come back since (in the chronic sense).
Your mileage may vary, obviously, maybe they will find something in which case this post is worthless, but if they don’t (and as you say you’ve been having panic attacks…), then try to understand what pressures and stresses you’re currently under and manage them accordingly.