It's kind of not a bug but maybe a wrong design decision. You set time on alarm clock. So if you set 7am and it's already 7:20 it will wake you up next day and you will sleep 23 hours.
Maybe some way to limit sleep past 12 hours or have time spend sleeping would help.
But I'm glad you pointed this up.