they had used the earth cable as live for the switch (rather than using two bits of cable or a 3 core and earth). I've no idea if the old PIR needs an earth, but surely that isn't safe? Is this common/acceptable?
As I understand it, there are several issues here.
1. Is the conductor adequately insulated and sheathed? for T&E the answer is clearly no, for flex the answer is generally yes.
2. Is the conductor correctly identified? the wording in BS7671 is a little unclear, and there was a thread arguing about this a while back, the NICEIC argue that it is ok to use a green/yellow core in a multicore cable for something else if it is oversleeved, not everyone agrees with that interpretation
https://www.diynot.com/diy/threads/niceic-snags-and-solutions-book.549589/page-2.
3. Have the BS7671 requirements to take a CPC (earth) to every point and every accessory been satisfied? If the PIR is not "current using equipment" then it's an accessory and needs a CPC taken to it. If the PIR is current using equipment then the termination of the fixed wiring feeding it is a point. You could argue that a short loop of flex from an outlet box is not fixed wiring, but once you start fixing wiring to the building, running it through holes in the building, running it through conduits attatched to the building etc then I think it's pretty clearly fixed wiring.
Further pain as the new style push fit junction boxes don’t like stranded cable.
Pure push-in terminals don't like fine stranded wire, because it's not rigid enough to force it's way into the terminal. Push button terminals like in the Hager/Ashley J803/J804 will accept it though it can be a bit fiddly as you have to hold the very stiff button down while you insert the wire. Lever terminals like the Wago 221 and 222 series are absolutely fine with fine stranded wire.
The classic Wagobox doesn't really give enough room to work with when used with lever terminals, but the Wagobox 221-4 solves that problem with 3 slots rather than 2 and with a special position for a 5 way block for the earths.