I might have found the cause for the behavior. The `msg->eoh` value is probably wrong when adding the new P-Charging-Vector lump after removing the previous one. It must be recalculated in `parse_headers`. I have created a branch for testing the fix. As the code was edited on a theory basis, can someone please test if it works? Thank you.
https://github.com/lachbaer/kamailio/commit/39f786dcd2f2f061d27d93ec403972d5...