Once the last block is mined at 21M, the miners will only be collecting the fee as there is no additional BTC reward as it has reached it's cap.
How much will energy cost at that time? No one knows.
How much will the transaction fees be at that time? No one knows.
So it is anyone guess if it will be economical or not. IMO, it will not be. If the fees are high on BTC, people will use other cryptos. If the miners are not collecting enough fees, they will most likely close down. (Large mining farms) There will still be people that mine and maybe some facilities will be setup with solar?
Regardless of the prices and diff rate it must be profitable else no one will be mining. And if no one mines then there aren't any transactions and the coin will fail.
An equilibrium will be reached and it will be profitable for those mining but there won't be enough money involved for new miners to want to enter the field.