As asmallchild said, you mostly encounter this in residency when jealous contemporaries feel the need to vent. Usually it’s when they’re feeling most overworked or under appreciated in their own department.
The good thing is, both you and the person in the other end of the deal know any insults are steeped in insecurity and/or jealousy, so they really don’t require a response or much of your time.
Fortunately, these people tend to be he vocal minority. One of the reasons I got into Derm in the first place was the feeling of being an expert in a field with which most other physicians feel very uncomfortable. Your skills end up being in high demand because most non-dermatologists actively run away from skin stuff and hide their head in the sand.
I also agree that out in the real world, it’s totally different. Most other docs love having you on the community.
I found that any opportunity to educate my fellow non-derm residents was good if they were receptive. Keep in mind that most non-derm doctors have never and will never even hear of 80-90% of Dermatology diagnoses that exist. So they really don’t know what they don’t know about our field. Which is part of why they act the way they do on the first place.
All in all, don’t let it bother you one bit.