This is something that first/second year philosophy students do debate.
They are not debating it.
> For extreme examples, would it be immoral to lie to the Gestapo about harboring Jews? Were people illegally helping slaves escape the American South being immoral?
If you believe in that categorical imperative, then yes. I’m not saying I believe in it or that Kantian philosophy is the only correct one. There are endless belief systems and philosophical schools of thought that can be used to answer that question, and they will have different answers for different reasons.