Not that I’m defending the train companies here, but to me this very much sounds like making up a situation to get mad at.
Buying a ticket after boarding on your phone very much is an offence if you boarded at a station where there were facilities. Every example we’ve seen so far is where a ticket has been flagged as “bought after departure” but the passenger has passed valid opportunities to pay.
But if I remember correctly we have seen people in such cases penalised for having an invalid ticket. I don't think there is any justification for this, and that the offence committed was actually boarding the train without a valid ticket.
Personally I think that the railway should stick to the law, just as it expects passengers to do. (Though I'm slightly conflicted on this one as a PF is generally a better outcome than prosecution or threats thereof for a bye law offence).
But if a ticket purchased after boarding
is somehow fundamentally invalid or the railway believes it is, that seems a good reason to me to avoid doing so if possible even if ought to be OK. It also of course avoids any argument over whether the machine was in fact working or not.
I'm not suggesting that buying after boarding in such circumstances is likely to lead to trouble (and I'm not getting mad about anything), but if you can avoid the possibility of such trouble, why not do so?