Looking back at your original post for ideas, you say, once in a while, can you think of anything that makes those times different either when it does or when it does not work? For instance, does it matter if you were recently using the app or if it was the last app you used before allowing the phone to lock? If WhatszApp isn't being put to sleep could it be that another is and somehow this is affecting the behavior of the device. So let's say you have a game that the phone is putting to sleep and you were just playing that game before the phone locked. Then you decide to send a WhatszApp message but instead of the phone shutting down just that game it goes to sleep putting WhatszApp to sleep with it. Did you find any apps in the sleeping lists? Maybe remove all of them I mean it seems pretty likely the device is going to sleep during this time. It doesn't seem to recognize that WhatszApp is being used and finding why, if not the app itself, then perhaps another app, seems to fit.
Let us know what you find.