On this screenshot you can see obviously, that the sleepscore average of 27 cannot be right. This happens at least once every two times, that the average does not match to the chart.
Could you please check your algorithm or is there anything I do not see?
Screenshot as link:
https://photos.app.goo.gl/usKHugmSi1qHz4rr8