Sleep mode on phones is configured to also close or hibernate applications in the background. There is a pre-defined whitelist which keeps only the basic functions available such as: GSM mobile, WiFi (if it's set up), power management, etc.
Access your Battery Saver functions and disabled it or add the call recording application to the whitelist and it should be recognized as one while it can run properly.