@abnv @running I had a similar experience and read up on it a bit. Wrist based (optical) sensors can give spurious readings sometimes and Garmin apply a lot of signal processing to separate out the heart rate signal from other signals like your arms swinging, and sunlight pulsing under the watch as you move, etc. Sometimes these methods fail. Be especially suspicious if your HR reading matches your cadence.
Otoh, the '220 - age' formula is what's known as a linear regression. It predicts the average - but there's considerable variation around the average. Iirc the standard deviation was around 10, which means 95% of people would expect a max HR within +/-20bpm of the formula, and 99% within +/-30bpm. So 202 for a 40 year-old is plausible.
I'm a similar age and I've seen 202bpm on a Polar optical sensor and 198 on a Garmin electrical chest strap, both running hard uphill.