Why is my '#id' transformed into 'data-drupal-selector'?
It's intentional as @clive says. You can select it using jQuery or CSS of the this way:

div[data-drupal-selector=your-selector-id]


If you want to use a id you can declare like this:

$form['referent']['#attributes']['id'] = 'foo';