I got my phone replaced but there was this same problem again. So that's what I did, Go to settings > Lock screen > secure lock settings> lock automatically> set the time to immediately. Try this on your phone and let me know if it works because it worked for me. Well, I got a software update two days ago and now I don't face any problem in my phone after the update.
... View more