When you say illegal, are you saying that the government have passed a law saying that you cannot touch anything on your bike? I find that amazing and assume that all the aftermarket parts suppliers are up in arms. Will there be demonstrations in London?
I suspect that this is just fake news spread on the internet and that the police will not turn up at your house if you touch anything on your bike.
Not going to stand up and say this is correct as anyone can do their own research. But I did read that it is now illegal to touch anything that impacts the emissions, so cat, the flap as this is noise emissions, but you can fit different end cans etc or headers if they conform to the EU5 standard. But I can't back this up and I can't be bothered to research it, so it may be fake news. Personally once my bike is out of warranty if the flap sticks I will use a servo buddy and get the light switched off with a GS911. Currently bikes are not subject to MOT emissions testing, but that can't be far away.