Booking round trip to Cusco, Peru from U.S. Irregardless of airline/flights pretty much all of them get you to Lima (from US) in early AM hours. From there it's a 6-7 hour layover before morning domestic flights to Cusco start up...
I presume one clears customs in Lima (and re-checks bags if necessary). Find your next gate and maybe nap for the remainder of the night/morning.
QUESTION: When getting to the domestic flight gate in Lima after customs - are domestic flight gates in a 'secure' area? One that you can safely flop down on while you wait w/o the worry of say a pickpocket or something in case you dose off?
QUESTION: Hotels in Cusco allow you to check-in early or drop bags for safe storage early and come back later in day for check-in?
(Traveled a bit in S. America (not Lima) decades ago (pre-9/11) - generally had few problems but crowded airports did pose some security issues back then)