As I don't want to give the OP false hope, I will begin tby making it clear that I have nothing twhatsoever to do with the railways......BUT...
Something we all do is to forget when we go out is to take things we need to have with us from time to time. I very nearly left my driving licence at home not long ago when I needed it to pick up a hire car at Knock Airport, I had to tell the taxi driver to turn round so I could go and get it.
What the OP seems to have done on this occasion is to have got on a train and when on it, forgotten that he/she has forgotten his/her railcard. It seems to me that faced with that situation, he/she has two choices, either to pay the full fare to his/her destination which could be many times the £40(?) paid for the advance ticket, or to abort the journey and lose the £40 and the cost of the return coach ticket, and instead buy a return to the next stop on the route and go back home. (The latter would have put him/her in the same position as being delayed on the way to the station and missing the train altogether, other than the matter of the fare to the next station).
If I was somebody with no knowledge whatsoever I would, faced with that, go to a train company employee (the ticket inspector) and seek advice, and surely the advice should be expected the advice to be "you can either pay (say) £135 and go to your intended destination or I can sell you a return ticket to the next stop for (say) £10, and you'll have to go home (maybe in each case offering to issue an UPFN if the OP had insufficient money with them).
From what the OP has said, it appears that they would have had to do the latter as he/she couldn't afford the cost of the (say) £135 ticket to the intended destination.
If we take the OP at their word (and I have no reason not to, particularly in view of the comments on this thread about TOCs having to send out reminders to on train staff about not telling passengers that they can get a refund) he/she explained the position), then he/she has explained the position to the ticket inspector who has effectively said, or at least led the OP into interpret what they were saying as something along the lines of "Don't worry, I can issue an UPFN to enable you to travel, and you can get it cancelled/get your money back if you go to a ticket office with the ticket and your railcard" to which the OP must have thought "Phew, how lucky I am, I was worried that I might have been told that I would have to go home and miss my trip away, and lose the money I paid for my advance ticket and my coach fare for the return journey".
Then, when reality strikes home, he/she finds that what the ticket collector said coule not have been further from the truth, and he/she is now being asked to pay money that he/she does not have, such that the £135 escalates to £161 and then £181....they would have abandoned the trip and lost £40 plus which they COULD afford had they been given the correct advise.
So essentially, the problem (if we believe the OP, and as I have said, there is no reason not to, so far) has arisen due to him/her being given wrong/bad advise by a train company employee, which is surely a case of professional negligence.
When I worked for an insurance company, I had to deal with many claims sucvh as this unfder professional indemnity policies, not railway related, but where people had suffered losses from wrong or misleading advice given by accountants, surveyors, estate agents and the like and to indemnify third party claimants for losses they had suffered where their claims were proven. Now than I am an self employed investigator, I have to take out a professional indemmnity policy of my own.
The trouble here is that the railways seem to live in a world of their own where some employers seem to be able to say what they like with impunity, and where the passenger is always the loser.
As I have probably said before, my daughter was PF'd when she was 16 and left her railcard at home, without realising. She had gone to St Albans (fare £3) and had bought a discountted ticket for £2. I was lad to believe that the person who issued the PF told her to send the ticket and the railcard in with an appeal, which we did. Paying £20 PF is bad enopugh but bearable, but incurring extra time and expense by lodging an appeal due to being advised to do so really does add insult to injury, all because the fare was £1 short. I could have driven to Harpenden station with her railcard within 5 minutes if I had had that option. It would be reasonable to assume that there is a database of railcard holders, since otherwise there would be no purpose in stating one's name and address when buying it, so it would be reasonable to assume (wrongly, I know) that a check concerning the validity of a railcard is a reasonably smple process.
Full marks to Cross Country. What other TOCs should realise is that goodwill counts for an awful lot, especially when things go wrong. As a first step, they could discount the fare already paid from the full price ticket/PF issued, at least passengers might then see a modicum of fairness.