If the STM32G0B Nucleo has embedded STLinkV2, there is the answer....
However the G0 series has many low pincount packages and swd pins are shared with boot, reset can become gpio, etc... as such, once badly programmed, there are possible irrecoverable mistakes. First safety would be to have a short sw delay at power on to give a chance for debugger to take control before the gpios are reconfigured.
You have masked the problem, not "found the solution". To connect to a G0, you must have SWD interface operational AND the cpu cannot be put to sleep with WFI or SleepOnExit - that's the peculiarity of M0+ core in its default setting. No Reset connection is needed.
In my G0 project, I usually turn on SleepOnExit in a timer ISR, some 5..10 seconds after device startup.
My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice