I think people forget the pressure that rail staff are under from those higher above, regarding passenger accidents, especially those involving the PTI (platform/train interface).
God forbid, if something had happened when you had gone over the yellow line and it had gone unchallenged by staff, first thing those higher above would be doing would be rewinding CCTV and pinning the blame squarely on the staff member for letting your behaviour go unchallenged.
It may seem as some staff being over-zealous (and I will hold my hands up and say I have been too in the past) but the pressure we are under as regards safety and accidents is immense, so when you do encounter staff doing this, as well as (honestly) being an arse-covering exercise for themselves, it’s a genuine concern for safety.