If Custom Routing will make document overwrited by same id

Yes.

If you do:

PUT test/_doc/1
{
  "foo": "bar"
}
PUT test/_doc/1
{
  "foo": "baz"
}
GET test/_doc/1

Then you will get this document:

{
  "foo": "baz"
}