You just described what it is to throw someone under the bus. 😊
To “throw under the bus” is a figurative phrase in English meaning to blame or abandon a person for selfish reasons. It is typically used to describe a disavowal of a previously amicable relationship to avoid being associated with something controversial or embarrassing.