A really honorable,but riskier act would have been to announce the switch before the primaries;or , stay in the party that helped elect you and fight tooth and nail for changes to your liking.
You’d have a point there, but LA has a different setup where everybody competes in a gigantic jungle primary (so no specific party primaries and party affiliation isn’t as important). It’s not unusual in runoffs for people of the same party to end up facing off.