@dirk Well, Dirk that sketch has 'a lot of moving parts'!
My troubleshooting approach is run my HotHead sketch and see if it will run on battery.
If 'yes' then we must assume that one of your many sensors are drawing too much current and lowering the Vinput.
Can you measure the battery voltage with a meter as you unplug the USB and switch to battery. (This may require a push of the little black Reset button to restart it.
-Terry