One solution to perform backups that may take longer than the default sleep time, that does not require preventing your Mac from sleeping, is using Power NapPower Nap which allows your backup to be performed during sleep while connected to an AC Power Outlet (assuming you are using Time Machine to backup). Note that backups can only be performed in this method if the Mac is connected to power.
Note that backups can only be performed in this method if your Mac is connected to power. However, this solution will work even during the OP's problem of manually forcing their Mac to sleep.
Power napNap can be easily enabled by going to Settings >System Preferences → Energy Saver and clicking the check box next to Enable Power Nap.
For more information visit the link above which refersrefer to anthe Apple support page.Support article: