No, Kamailio should definitely not be rewriting the Contact. That is set by the remote dialog parties only.
If the ACK is being sent directly to the host in the domain portion of the Contact address, that is because the endpoint is ignoring/not honouring Record-Route. That's radioactively wrong behaviour and should be fixed.
Reinvites do not alter the Route set, as clearly stated in RFC 3261 ยง 12.2:
Requests within a dialog MAY contain Record-Route and Contact header fields. However, these requests do not cause the dialog's route set to be modified, although they may modify the remote target URI.
-- Alex