TLDR; The cost of a bad hire is extremely high and not worth the risk.
I'm a team lead and do a fair number of interviews. It's amazing how many people can talk about their experience and make a ton of really impressive statements that makes it appear as though they are knowledgeable and then that person can't perform a simple coding exercise. On the other hand, it's equally amazing how a person can do an excellent job coding but not be able to get through basic day to day human interactions with their peers.
If a candidate falls into either of these camps, they are an easy no hire. If a hiring manager ends up hiring a candidate that is difficult to work with either because they can't code or because they have poor social skills, it can be very costly. It often takes several months to find out that you made a bad hire. By the time you figure it out it's often taken a large toll on the team and can lead to productive team members leaving.
When you finally find out that you've got a problem most companies have a huge process to go through for firing that person and that process is super intensive and takes months. Not to mention how emotionally difficult it is to tell someone they are so bad they have to be fired.
All that to say, the cost benefit analysis is clear only hire people that will over time be a net gain. Don’t take any risks ever.
If I were a recently graduated software engineer, I would be hedging against these risks in every way. I would produce a lot of code in the area I’m seeking to be hired. I would work a lot on being friendly and carefully choosing my words, so I don’t sound like a know it all or a person who enjoys conflict. I would prepare statements about my goals of how I fully intend to spend at least 3 years at this job if conditions allow, and I would practice being humble.
No one actually expects you to spend the next 3 years at a job if it’s not going well, you just need a way to express that if it’s a good fit you intend to stay put and do a great work. 3 years is just an arbitrary number.