Erratic hear rate during activity

I have observed my Garmin Vivoactive 5 showing the wrong heart value during some activities (not always).

According to my observation, the error in HR is rectified by:

1. Stopping the current activity on the watch by pressing the stop button. (I think during this time, this was an autostart activity of walking, using move IQ)

2. During the automatic changing change of activity mode in the watch, like during a benchmark run where after 5 mins of run, it shifts to cooldown mode.

By doing this, the heart rate jumps back to normal value, even though the position of the watch in my hand didn't change. This led me to believe that, this is a bug in the device rather than an issue with the optical heart rate sensor.

I have attached an image showing my heart rate jumping during the benchmark run. I have also included the HR graph of the run I made shortly after a rest, using regular running activity on the watch, which depicts what's usually recorded for my running.