My Octoprint keeps crashing, I dont know why

Yes, I had this problem, the unit worked fine until I added a few plugins that then caused the Undervoltage, changed to Pi power supply and all fixed, Mabey change the background on the screen to Red for low voltage, I believe there is plenty of units that need a more powerful supply.

Using the USB is probably not much benefit, it's another place for a Voltage drop, but take a high quality USB power (3A spec should do) cable and just cut the other end off if you're doing it.

If staying with GPIO, make sure you connection on the GPIO is good, Dupont connectors can have a poor connection.

When tweaking your voltage make sure i is running and measure at the Pi itself, tap a ground and then a 5V line (or the other GPIO 5V pin). Tweak to 5.1V at the Pi. It easily handles it, that the same the Pi PSU provide at the Pi.
This allows a bit more voltage drop on sudden current draw.
It may be your DIN cannot take a sudden change, though if it's specified like a meanwell you've 6A to play with, so the drop off curve shouldn't be hit and nothing there looks to be attached to the Pi.
Is anything else powering off the DIN rail ? If so it could be that that is causing the Pi's voltage to drop suddenly.

I thought the usb port was a bit more protected. Eventhough the din-rail psu should be able to handle it, I don’t trust the din anymore. I also hate using and making the connectors for the gpio. Absolute nightmare!
I’ve decided to take out the din psu and re-route the micro usb to an external case micro USB port so I can power it with a pi psu. I’ll hate the look and am disappointed but I want to get rid of these problems.

The two din rail psu’s have dedicated tasks. One is to power the ventilators the other was to power the pi. But if the printer board is powered of the pi does power the board a little bit.