Marlin is restarting when pins 5 Vcc are enabled and has a servo motor connected (RAMPS 1.4)
PSU is only feeding 12 V into RAMPS, but (if I remember correctly) RAMPS is using Arduino's onboard regulator for converting 12 V to 5 V. That regulator can not provide much power.
If you connect some significant load to any 5 V pin (like servo, LCD backlight, or BLTouch), the regulator will be overloaded and its output voltage will drop (too low or unstable voltage will prevent Arduino from running correctly).
You can prove this hypothesis by measuring the voltage on any 5 V pin when Arduino is in &quot;infinite restart&quot;. It will likely be far below 5 V.
Connecting USB helps because it provides additional power for 5 V rail (but you may be overloading the computer's USB port by doing this).
The solution is to get an external 12 V to 5 V regulator (with enough power, something like 3 A should be ok) and connect it between PSU and some 5 V pin on RAMPS. (Or get PSU that has both 12 V and 5 V output)
If you get an external 5 V supply, it may be a good idea to then completely disconnect RAMPS from Arduino's 5 V regulator. Have a look at https://reprap.org/forum/read.php?219,799595
Also, the regulator on the Arduino board will likely be overheating and may get damaged (But regulators usually have some overcurrent protection so it probably will be OK)
The regulator is located somewhere near the power connector on the Arduino Mega board, Google &quot;AMS1117&quot; if you don't know how it looks. Replacement is possible with intermediate soldering skills. The regulator is only used when powering Arduino from power connector or Vin pin (RAMPS uses the Vin pin). If powered from USB or 5 V pin, it can run without it.