Why would miners invest so much into electricity for half the reward? I see this ending badly
Absolutely not. That's how Bitcoin is designed. It tries to space out the block to once every roughly 10 minutes.
If there are less miners, difficulty would simply go down. It won't slow down anything, except for the last high-difficulty block. Blocks would still be generated on-schedule.
First i don't think the halving will end badly, as a matter of fact there is one large company who plan to add another 10 pentahash of mining power. Second, if miners is about to stop or let half of them, it is true that the time to solve the next block for the current difficulty will be doubled but the next block will certainly adjust to the current number of miners making the block generation normal. So basically the hiccup for a sudden decrease in mining power will be temporary.