5-6 hours is sufficient buffer IME. 8-10 hours would afford enough time for an excursion outside the compound of LAX for lunch or dinner if that tickles your fancy.
I did a 7hr layover there one time to save a significant # of miles on an award routing.... even with the decent lounge scene (this was pre-covid mind you), I was bored by hour #4.
Any more than that, you might as well just make enough buffer to get a hotel room and have a decent night of sleep in a real bed.