The phone is a Samsung Galaxy J3 running Android 5.1.1. It is only a couple of months old. This phone has not been rooted.
When I set an alarm, very often the phone does not wake up and ring when the time comes up. However if I press the power button to open the unlocking screen the alarm starts going off, as if the phone was catching up to the current time.
I changed to using the application Timely, after seeing similar questions on the Internet about the built-in alarm app. I still have the exact same problem.
My phone is always on vibrate. I haven't made any tests as to whether that changes anything but I don't think it will, because sporadically the alarm does ring at the right time.