[xy] fail assertion only if existing prefix is being changed (closes #139999) [applied]