To be totally honest, I watched all the episodes of You and I didn’t twig at all that Hari Nef was a transwoman. And as you say, it was not part of the character. So that is a good example then.
I twigged straight away and googled who Hari Nef was, but as you say, didn't make any difference to the role or story, so not really an issue. Certainly didn't go unnoticed though, and I think it was appropriate given the boyfriend's character - Ethan.
I can see why it would make sense to cast trans people as trans people and why they might take issue at eg natal women being cast as trans women, taking a role that they would be perfect for.
I feel the same about Kevin McHale being cast as Arti in Glee, I'm sure there must be many amazing performers who actually use a wheelchair that could have played that role. And obviously its frowned upon these days to be cast outside of your ethnicity.
However, if you start saying who can/can't be cast in whatever roles then you're playing an impossible game, as some of the examples upthread suggest.
By all means, make sure to be represented where appropriate and to include trans actors without making a song and dance about it, but that doesn't mean shoe-horning trans actors into non-trans roles just to make a point.