The problem is that if you go into stop mode sleep (pin + time) there is no indication to the cloud side that you've gone offline. Thus the cloud continues to send requests to the device.
In addition, since you're using SLEEP_NETWORK_STANDBY, the cellular modem is still on and able to receive the requests, so the cloud just ends up timing out the request.
What I would do is use the wake on RI feature as described in the post below to wake up your device from sleep so it can handle the function call, rather than having it time out.