There can be two reasons for which you have a long wait undressed.
it is first in a group examination as it was at my time at mandatory school physicals, sports physicals or summer camp physicals or draft physicals.
Since there was a great number of boys or young men to examin, we were instructed to undress in group in the outer office or in a locker room or a corridor before the examination by the doctor and it lasted often a long time.
At school physicals, the group was about 15 students supervised by a male PE teacher, all the students were instructed to undress quickly in briefs immediately after arriving in a locker room and it lasted a long time, you were called one by one by the female nurse on alphabertic order and if you were one of the last to be called because of your name, you had to wait for about two hours and a half and exposed to the view of the other students and the PE teacher for a very long time.
of course it was the same at physicals for summer camp or for practicing sports since they were generally performed in group
and it was worse at draft physicals where we stayed undressed in the nude for about all a morning and in a bigger group
The second reason is different and happens less frequently
it is when a doctor or a nurse who is in charge of the examination is temporary called outside while you are already undressed.
I have known that situation at a university examination for the second year . I had been instructed by a nurse to undress in a cubicle and once in brief told to enter in the examination room and the female doctor had began the examination when there was a phone calling, she told me that she had to go outside for a while and that I might wait sitting on the table for examination. The nurse get out with her without any explanation and they came back only ten minutes after.
During all this time I was just in brief because I had not been told to dress again and I did not know how long she would be gone out.. It seemed very long and after a few minutes I was beguinning to get cold.
I think that she had certainly a good reason but she might have told me to dress again. When she came back she was in a hurry and treated me more roughly than expected, pulling down my brief herself when necessary to inspect my genitals instead of asking me to do it, and then telling me to remove it to stand in front of her first and then to turn around and bend over and so on .. her voice when giving instructions was more stern, it was visible that she was irritated of course not by me but it was me who was submitted to her bad humor. I was expected to obey to her instructions immediately without any reluctance or hesitation.
Aside this case, I remember also as an adult to have been in such a situation a few times because of a phone calling of the doctor during an examination or the coming of a nurse or a collegue to go outside for urgency.. As they do not know how long it can last, they do not tell you to undress again and in France we have never a gown as a male patient at a doctor's office, so it is always unpleasant but we cannot do anything and generally the doctor asks at you to apologize him after..