So energy in Spain is cheap because they produce a lot but can't sell a lot easily, and Austria/Central Europe is expensive because they sell their domestic energy too easily?
If this is what you meant, then it sounds like an argument against free trade, if it means you keep ending up with the short stick.
Economists would say that the money coming in outweighs the higher costs and therefore you could redistribute that money and everyone comes out ahead.
Whether that happens in real life is a different question.
Electricity is expensive in Central Europe because the ETS system (carbon trading) has made fossil based production expensive.
We’re right in the middle of the transition with maximum volatility swinging between extremely cheap renewables and expensive fossil plants.
Free trade doesn't always benefit everyone equally, only a net benefit overall. It's a bit like how people often misinterpret the second law of thermodynamics "but the entropy decreased when the ice froze!"