Heat pumps are still a long way from the theoretical efficiency they could achieve.
For example, if I use a heat pump to cool my house down, and then later change my mind and use the same heat pump in reverse to heat my house back up again, in an ideal world I can get back all the energy I put in. (Assuming ideally insulated house)
With today's heat pumps, I get back nothing.
With in-the-lab prototype heat pumps I get back perhaps 1%.
But physics says I could get back far more if only we could get rid of the big inefficiency in every step of the process.
The main one being that every component of a heat pump becomes more efficient if it has smaller temperature differences between every component.