edit.
The guard was correct as your ticket is not valid after 0230.
I do find this post rather odd. There is no way that Leeds station is going to have any revenue protection staff there for those trains, and no turnstile...
Are you sure?
I am 99% sure there is an easement that specifically allows the overnight TPE services to be valid on tickets purchased the previous day. For example there is a train to York at approx 0330.
I believe the ticket clerk was right, and the security person was wrong.
No guard involved by the sound of it, but I bet the guard would have allowed it.
In my experience, the guards are the most knowledgable (but not always) followed by the ticket clerks, and finally the barrier staff are usually the 'weakest link'.
If you consider how much harder it is to get a job as a guard than a barrier ticket checker, you can see why some (not all by any means) of them are so awful.
I reckon kwvr45 will be along shortly with details of the overnight TPE easements...!
--- old post above --- --- new post below ---
For clarity the ticket office and barrier at Huddersfield is operated by TransPennine Express but the ticket barriers and office at Leeds are operated by Northern Rail..
I'd write to them both. I'd ask TPE because you are their customer. I'd ask why do they allow Northern to check tickets for use on TransPennine, when Northern do not even know the rules? Ask what steps TPE are going to take to ensure this does not happen again. Ask for a refund, plus a £10 admin fee for your time.
I'd seperately write to Northern stating that I was not their customer, and that a member of staff representing Northern had absolutely no right whatsoever to prevent me travelling validly with another operator, and that the bad experience with Northern means I will be choosing to take my custom to other operators such as TransPennine. Make it clear that ignorance is no excuse as if the member of staff was unsure, he should have checked! I'd insist on an apology and I would ask the key question: what steps are they going to do to ensure that this does not happen again? State that if no satisfactory response is recieved you will be informing Passenger Focus, your MP, etc.
Any other company would take notice of this and be concerned, but Northern are unlikely to be too bothered as they have a habit of treating their customers like dirt because they know they can get away with it. Worth a try though, especially if they think you're going to push it, they might do something.