Apple usually provides service up until the device becomes what Apple considers obsolete, though iPad repairs are usually device swaps. That’s usually from five to seven years from the initial release of the model, though that timing can sometimes vary.
Here is what Apple states: Obtaining service for your Apple product after an expired warranty - Apple Support
iPad Air 4th gen was sold from 2020 to 2022.
Whether or not any purchase is or was a mistake is entirely up to the buyer, and the buyer’s own details and decisions.