Those compressions and decompressions take up immense amounts of energy. They are less efficient than simply burning gas. On the flip side, could we not create electricity generation and heating from Natural gas?
Most of the energy is coming from the ambient air, only a small amount of electricity is used to change what temperature that energy is available at.
[1] A very simple mental model you can use to understand the difference between temperature and energy for a gas is that temperature is the number of times the gas molecules bump into each other in a second, while energy is how fast the gas molecules are moving. So if you have a very low pressure gas, even all of those molecules have a ton of energy in the form of motion, the temperature of the gas will be quite low because the gas molecules won't interact often. But compress that gas down to a small volume, and the molecules will bump into each other all the time even though they don't have much more energy.