Its happens in all multi crew control situations with command.
We have the same thing multiple times a day while flying. Air traffic control, marshalling of aircraft on the ground, technicians and technical issues, operations etc.
The Captain has ultimate authority and responsibility but 99.9% of the time you follow what you have been requested to do. But occasionally you have to put your foot down and say NO. And then when someone try's to bully you then you assert your command.
Its a very personal skill set and to be honest you can't teach airline Captains to have this leader quality. There are also cultural differences come into play. It takes about 6-12 months for people to grow into the role. Some fail and unfortunately have to go back to being a follower.
I will admit 16 years ago now when I was doing my command course I had a pushy air traffic controller trying to push us into a situation which would have solved his problem with another aircraft but would have taken away my escape options. I refused he got stroppy and it was instinctive to shut him down and assert my command. That 5 seconds after you say something did make me pause but then you have the rest of the flight to complete. Debrief was short and sweet. Good call, nicely dealt with, he wasn't happy but tough you are the Captain I think we can sign the command responsibilities and asserting's them section off.
I am pretty certain its the same in maritime after doing crew swaps with supply boats for the Northsea. Some Captains were the micro managers and others were more relaxed but you knew if problems occurred there was one boss.
I suspect the bloke that told the pilot to sex and travel is similar to myself. Comes from northern latitude stock, started life in heavy industry with rough men to manage and has a instinctive reaction when his third sense alarm bell is triggered.
I also suspect similar to myself we are best kept away from the office admin staff and office politics because it really upsets things when our bull in a china shop method of conflict resolution comes into play. But such is life bosses are happy that the job gets done safely and economically, our crews are happy because they have a boss that doesn't take any shit and protects them.
I like nothing better after working a week down route when the most junior usually young lady onboard feels comfortable enough to tease me in the crew bus because say my uniform is showing a weeks worth of wear and I could do with a clean tie. "hey Alistair are you going to make soup with that tie when you get home?" I think it means that I have managed to promote communications in my team with even the most junior feeling they are empowered to speak to me. Which I believe is crucial for flight safety. I know some crew its only the number 1 cabin crew who speaks to the Captain. I would hate to work in that environment. In fact if it was normal in a company I would be looking for another job pretty quickly.
In case the above sounds a bit to aggressive, the skill I told new commanders was the most important was the ability to listen even if what you were listening to was bollocks. But there are times which are relatively rare when you have to shut the person speaking down and assert command.