They’re illegal not because of a law but because they were never issued for public use. They were used (briefly) for internal treasury / fed transfers. (Sort of like the mythical trillion-dollar coin that gets talked about every time the debt ceiling conversation comes up).
Because they were never issued privately or meant for use outside of the treasury system, if an individual were to own one it’s because it was stolen or otherwise improperly taken from the treasury.
There are rumors that a few exist in private collections (and I’ve heard of one a single degree away from me), but I’ve never seen it or confirmed that it’s anything more than a rumor.
There is one in the Smithsonian national collection however, and if you get an appointment to view the collection you can see and hold it. Pretty cool.
you have the same problem spending $2 bills in the US
https://en.wikipedia.org/wiki/Banknotes_of_the_pound_sterlin...
Looks as though it's just Ulster, Scotland and the Crown Dependencies nowadays
Edit: https://en.wikipedia.org/wiki/Danske_Bank_(Northern_Ireland) Danske bank is a Northern Irish bank (I had never heard of this)
Not that many 500/1000/5000/10000 notes were used in practice either. Less than a thousand of the big ones and a few hundred thousand of the "smaller" ones even exist. They're all in collections now as the Fed requires banks to return them for shredding if deposited. Collectors will pay a lot more than face value for them so you'd be nuts to try to spend one.