I like what Laurie A had to say. Essentially, he was giving a time out. Maybe Dad didn't know about the knight costume. Maybe he thought threatening to take something away was a "worse" threat than making him stand in the hallway for a minute.
(ETA: And he was at least cognizant of the fact that he still had a child in the tub that he couldn't leave unattended, so he removed your son from the situation without leaving the other child in the bath alone.)
Dad's do parent differently, even if using the same "method", than moms do. It is one reason that kids need a mom AND a dad.
Yes, you could construe that what your husband did was very mean. But just one incident does not mean that he is doing anything harmful to your child. Without other examples that demonstrate a general lack of concern for your son's feelings, I wouldn't make an issue of it. But, what I would discuss with your husband is that sometimes (especially around this age) explaining the reasons WHY something needs to happen helps with compliance.
Some people mistakenly think that explaining something means you are trying to convince a child to do something, when they really don't need to be convinced, they just need to "do". But kids are sponges and if you explain something to them, it can make them understand why compliance (rather than disobedience) is smarter--not to avoid discipline, but for the actual reason the action is required to begin with: like the hair rinsing.
You also might make some suggestions (suggestions--not telling him he is doing it all wrong!) to Dad, about HOW to give the bath in a way that is more conducive to compliance for your son. For example: my husband's way to rinse shampoo from our kid's hair, was to fill the rinse cup with water and dump it straight down over the top of their heads, while they were sitting there playing with whatever bath toy. They HATED him giving their baths. MY method, was to tell them, "look up at the ceiling so I can rinse your hair", which they did, and I poured the water more slowly from the front of their forehead, back towards the back of their head--so that the water/suds all ran down their backs and not in their faces. It was also way more effective at actually getting the shampoo out.
But, dad's are notorious for not wanting moms to tell them how to do things. They have their own way. But, JUST LIKE the situation with your son/husband, if you take the time to explain why doing something THIS way is better/easier, they might be more willing to accept it and do it than if you just say "do this". ;)
ETA after your SWH: Yelling? You didn't say he was yelling in your original post... not that I read. And I read it more than once. Was he yelling through the door? Because I might have done that, to be sure he could hear me through the closed door.
And honestly, the more times I read it, what stands out to me most is your child telling your father "No" to an instruction. If my child told me "no," I'd not be talking ever so sweetly to them. It just doesn't happen. Never has. "I don't want to" is fine, "Do I haaaave to?" is fine, "Whyyyyyy?" is fine, but to tell me flat out "no"? YAY for dad for plopping him in the hallway. He was patient for a bit before for the first "no", and the "no" is what was the straw that broke the camel's back. Then when he told him "no" again, Dad didn't waffle but served up the same response for flat disobedience. Good for him.
You might very well find, in a few years, that you are extremely grateful for a husband that expects his sons to obey his parents. My son is now 14, in another year he will be bigger than me. When they are small is when they need to learn to respect their parents. "No" is backtalk and disrespectful.