Can you retake a class twice if you failed the first retake? (serious)

So I’m from California, and I took a bunch of AP classes last year and I overloaded myself so I failed one quarter of one of my classes, and I’m taking it right now. I’m at risk of failing it again. Are you allowed to retake a class twice if you failed it on the first retake? Thanks!

I don’t know if the state of California has any restrictions on re taking a class twice, but I live in Texas and I’ve heard of people here doing it before. You should be able to, though you might have to talk with whoever is in charge of scheduling at your school.