Continuing a set until another rep with good form is impossible.
There are two kinds. Technical failure is the point where form breaks; absolute failure is the point where the bar stops moving. If you programme failure at all, programme technical failure.
It has a place: the last set of an isolation or machine exercise, and the occasional check of a client's RPE calibration. It does not belong on heavy compound barbell lifts, early in a session, or on every set of anything, because the recovery cost is high and the extra stimulus over stopping one to three reps short is small.
A workable rule: one exercise per session may end with a set to technical failure, and it is never a squat or deadlift.