How to show a field value instead of the node title for nodes displayed through an entity reference field? Edit: I think I found the place, just not the method yet. If correct, I will close this question. Sorry.

I have no clue which hook or direction to look into. I would like to have a label or title preprocess function, but that doesnt exist I think.

Its only for a specific content type that I need to show a field's value as title for the referenced nodes.

So it's not about the entity reference widget when editing nodes but rather the title display wherever that reference field is rendering the nodes' titles.
No code necessary, Drupal has built-in features for this:


Create a new view mode singlefield for the referenced content type foo, showing only the field value
Optionally, create a very minimalistic template for this node--foo--singlefield.html.twig
In /admin/structure/types/manage/foo/display change the view mode of the host entity reference field to Rendered entity, using view mode singlefield