I usually check in 2.5 hours and never had any problem. That lost baggage case may be any mistake.
In my opinion the main issue is to get to the airport. If I have to be at the airport at peak hours, specially evening, even at 10pm, I consider 90 minutes of taxi ride from Miraflores to the airport. It can be faster but you never know. Traffic is unpredictable in Lima.