This question basically boils down to "can you write bug free code the first time every time". The answer that is always going to be no.
Yes, there are practices that can help, you can isolate modules that you can compile both for the embedded and desktop, and test and develop on the desktop. You can create hardware abstraction layers that help isolate those modules so you can test and debug them easier on PC.
There is certainly value in reducing the usage of debuggers on embedded platforms, as they are typically much slower than on PC and your REPL is therefore much slower.
But, eventually something will come up that requires a debugger of some sort. Sometimes that's a JTAG debugger, sometimes it's an oscilloscope, or a blinking LED.