Fixed #22922: Better error message for InvalidBasesError.