From me for example. I follow this studio and team since many years and i’ve participated to the funding of Divinity: Original Sin (DOS) more than a decade ago…
They got money from several sources but mainly because (or i should say thanks to) they delivered good products, they have being able to survive and work on BG3. Luck is not the reason, they’ve worked hard to achieve that…
Was going to say that.
@OP:
One of the main skill a developer must have is being able to troubleshoot properly how their code behave.
Break your code in small pieces, check all of them with unitary test (formal or not) to validate their behavior then move to the next step. Never test everything in one shot or you will be overwhelmed by side effect bugs whom will distract you from the real root cause.
Being a programmer is not just coding but also testing and deploying (even locally).
That won’t avoid you being blocked by a silly mistake for hours, everybody did that at some point in their career, but that will reduce your frustration against yourself when you discover why the bug existed.
Do a pause, go walk, change the topic and the next time you look at your code, you will spot the obvious bug :-)