I'm not saying "do not bother me before precisely 60 minutes have passed," but just "go spend some time with this before you start pulling in other people, but also do not hesitate to pull someone else in if you've made literally no progress in about an hour."
I make sure that anyone in my office who is new or is my junior knows that I’m the person they can always interrupt. People never interrupt too much.
May I ask how long ago this was? Although shit colleagues and shit workplaces still exist, it feels like these days it would be shut down pretty quick by HR in the average company.
It's fine to be friendly with HR (some wonderful people work there), but remember who is paying them and whose interests they are supposed to look out for first. Definitely not yours.
HR wants all the info they can get from you. They will cheerfully listen to everything you tell them. And then they will do their job, which is to analyze the situation for potential risks around legal exposure, and take steps to mitigate those risks.
I would basically never bring HR in to a problem unless you are very confident that solving your problem and the goal of protecting the company are truly in alignment. Maybe retraining the manager is better for the company, but who knows. They can also solve their problem by removing the new employee who is being treated badly.
I go even further than that. I tell juniors there's literally no way you can screw anything up so badly that we can't deal with it. If they write code that doesn't do what it's supposed to do, and it's not caught in code review, the reviewers are more to blame than they are, because they're supposed to know better. A junior shouldn't have the access level necessary to do something like drop the production database -- that's on their more experienced colleagues to set up those guard rails.
For me, if somebody swore about something I was doing, I’d likely laugh and challenge them to either ask how I’d fucked up or how they’d recommend doing it.
Early on in my career, I had a "mentor" tell me to try it on my own before asking any questions only to swear under his breath when I messed up. It was a massive source of anxiety balancing between asking a question and the risk of messing up.
When working with junior engineers nowadays, I go out of my way to let them know that any question at any time is acceptable. I'll put down what I'm doing and help them through a problem and then celebrate the solution with them. I never want them to feel the fear of work and failure that I did.