I don't think is related to Record-Route, maybe to the presence of Contact in the ACK (usually is not).
Anyhow, the xavp seems to be required every time a Contact has to be generated when contact_mode = 2 -- that looks like what code requires. I replaced the use of avps with xavps, but my patch doesn't seem to affect what was in the initial implementation done by @henningw - maybe he can comment more and say if it's expected behaviour and a PR needs to be done to cover your case.