See: https://forums.garmin.com/developer/connect-iq/i/bug-reports/onexitsleep-is-called-after-each-wrist-gesture-even-in-high-power
That bug report has 8 comments, but you won't see all of them unless you click Oldest or Newest.
Someone looking at that post might not even realize there are more than 5 comments unless they look carefully at the the comment counter.