The basic equation the rewards from mining using X hardware over it’s useful lifetime vs the rewards from using that hardware for a 51% attack.
Today's block subsidy is currently 6.25 BTC, and the amount with fees is around 7.2 BTC. That's nowhere close to the pre-halvening about of 12.5 BTC.
Not that 1BTC per transaction is anything close to a constant, maximum rewards over the last 3 years where more than 100x minimum rewards, but it does seem independent of block rewards.
https://www.blockchain.com/charts/miners-revenue
With every halving, assuming price remains constant, BTC miner revenue, and with it, energy expenditure, declines, until it's 10% of current energy expenditure.
You're right that this could pose problems for Bitcoin's security, but that's unrelated to the fact that Bitcoin miners' energy expenditure as a share of BTC price will decline.