When should you be riding by HR instead of Power and what can you learn from a HRM when you're riding by Power?
There is only one occasion I would consider use of HRM has priority over a power meter (or indeed no monitor at all and simply using perceived exertion), i.e. your doctor or cardiologist has specifically requested you not exceed a certain HR.
Otherwise there is no time that, if you have a power meter available, using an HRM trumps using a power meter.
One of the problems in answering the question is it's considering the quite narrow paradigm of training by power, in the manner that one might have used HR previously.
There is far more to training with power than is ever possible with a HR monitor. But that is for another discussion.
So if we are to consider only the narrow paradigm of using power meter to set training levels and to guide intensity of effort while riding, then there is very little extra to be gained from HR data. There are many who believe they can read the HR tea leaves but there is very little valid actionable intelligence to be gained, and if anything the risk is high that it will be misleading or poorly interpreted.
HR response is naturally variable in a day to day sense, and varies depending on many factors other than how hard you happen to be riding. Unfortunately the impacts of those factors are themselves quite variable and one cannot reliably parse them out by looking at HR or HR:power ratios. e.g. fatigue can result in either an elevated or a depressed HR response for a given power output.
If your HR is a little elevated or depressed on any given day, then provided you are banging out the power OK it really doesn't matter all that much. If it's significantly varied though, then it's just as likely that your level of perceived exertion is also telling you something is up and/or you are simply not able to sustain the power level/range that you might ordinarily expect, or perhaps you realise you can go somewhat harder. HR does not add much to the combination of power and level of perceived exertion.
HR has its uses if you are not using a power meter but its utility is confined to primarily guiding sub-threshold mostly quasi-steady state intensity. It's pretty much useless for guiding any supra threshold or highly variable efforts since the lag in HR response is such that most such efforts are nearly or completely over before one's HR actually reaches such a nominal intensity level.
As power climbs towards threshold, one also need to be aware of cardiac drift, the perfectly normal gradual rise in HR while riding at one's metabolic control limit (threshold). If you attempted to pace such an effort with HR and did not account for this, it's highly likely your effort would be poorly paced (started too hard and power will fade throughout).
Below is an image showing typical HR response during interval efforts at around threshold power level and shorter harder efforts that are close to eliciting a state of VO2max. Note the response lag time, and how little time during the harder efforts HR actually spends in that nominal maximal aerobic "zone":
You can tell when you are knackered.
Power indicates your actual output. With a baseline of previous power and HR data, you can establish a model for what you should be able to do. When your numbers start to fall way outside your model/baseline (you normally produce 250W at 80% of your max heartrate, but now you are only producing 200W at 85% or 90% of your max heart rate) it might be time to do something about it (check hydration, calories or just end training for the day). Additionally in off training times your resting heart rate can be looked at as an indicator for how well recovered you are.
Power output is a finite number that is extremely useful because comparisons can be made directly across riders. However, your own stats bio metrics are more useful to you as an individual because they can help guide your training and prevent you from overtraining, help show your individual improvement, and let you know when you are recovered and can accept an increased training load.
A heart rate monitor (HRM) measures cardiovascular system effort, while power measures muscular system effort. When averaged over long periods of time the two are typically highly correlated, they can also diverge depending on the circumstances, for example in a sprint your HR will lag behind your effort or your HR for a given power effort can vary by fatigue level and hydration level.
Looking into the interplay between the two can give you a lot of insight into performance. For example, using a higher cadence will elicit a higher heart rate, but might let you sustain a higher power output, or let you keep your legs "fresher" for a given power output. (By "fresher" using primarily type 1 fibers instead of type 1 + type 2 as type 2 are best "saved" for short power bursts such as sprints or pursuits). By experimenting you can start to learn how to get the best performance. While power ultimate is what wins races, your muscular system is supported by your cardiovascular system, the two need to be considered in tandem.
HRM is also good for nailing down your heart rate training zones. Most training material will still refer to these zones. You can use an HRM to accurately determine your zones if get good estimates of your max heart rate (all out effort in a race) and resting heart rate (when you wake up). If you keep a long time series of data this should be easy to determine. DO NOT use that horrible 220-age formula for your max (the 95% confidence interval on that relationship is something like +/- 30 bpm), it can only be reliably estimated under extremely intense exercise and shouldn't be attempted by people with any sort of pre-existing heart condition or untrained. Once you have accurate estimates of your HR zones, you can for example know with pretty good certainty that hard effort you thought was anaerobic, actually wasn't, therefore there was more power that could be teased out.
Finally, as pointed out by @SuspendedUser HR can be good at monitoring fatigue and general health (e.g., hydration levels). If you are not cannot maintain a particular power for heart rate zone this could be an indication that something is up. General long term training fatigue is probably best measured by max heart rate in all out effort. If you went as hard as you could but didn't hit your max there is a good chance you are over-trained. Resting heart rate will also elevate under fatigue.
HRM's tend to be more affordable than PM's and you don't need to remove them from one bike if you train with different bikes.
If you don't know your LTHR and FTP, I think you're better off using a HRM if you must pick one or the other.
A HRM can give us an idea of when to back off. For example, elevated core temperatures can increase our heart rates. Recently, there's articles warning against extreme endurance exercises. It may be a healthy choice to avoid overworking our hearts by proper cooling or backing off. Experts seem to agree that we should limit our HR to 85% of its max.
I use an HRM with my PM when training indoors to monitor my cooling and hydration strategy.