During my career, I have seen several incidents, where a developer tries to solve an issue for a very long time, definitely not in par with his previous achievements. They know the solution is right next corner but couldn’t not grab it though.
I will be more generic. They try a path one, but their subconscious mind or murmuring gut definitely points to path 2. But we are fixated on path one as it is what we thought of first. And it must be true.
Just take a break. You will find the solution right in-front of you of you. I insist any developer who is Starting their career please try to make a habit of memorising all the error you encounter. If you encounter way too many errors to memorize, at least read it. You will find tour solution within the errors.
I get a few raised hands immediately. “What if we are script programmers? We don’t have any compilers to show errors.” My advice is try to find some patterns. Patterns help us find the cause and issues of any problems.
Read your errors. It will help tour career very much.
Happy Coding!