This isn't true at all. Gas is much cheaper per joule than electricity.
Getting six joules requires favourable conditions and a good setup, but the normal expected efficiency is considerably above 100%.
Gas is (normally - I'm on a variable tariff and being paid to consume electricity at the moment) cheaper than electricity per joule, but not so much that it works out cheaper than a heat pump to achieve the same effect.
[0] https://www.eec.org.au/for-energy-users/technologies-2/heat-...
I'll end up getting it anyway when I get an AC system someday, but it'll have to run off solar to be worthwhile.
There is actually a tip-over point. For a given price for gas, and a given price for electricity, each will be more economical at different points because the efficiency of heat pumps (for heating) is a function of the external temperature.
There are calculations that can be done to determine this point:
* https://c03.apogee.net/mvc/home/hes/land/el?utilityname=ever...
* https://masslandlords.net/heat-pump-vs-furnace/
It's not as clear-cut as you make it sound: