Hi
Another update to my tailgate issues.
So I did try swapping over the tailgate latch mechanism (ebay used for £25) and the external central locking switch (ebay used £15) on the tailgate to the right of the normal boot switch. Neither was successful. The one obvious part being the actual switch itself but seemed to very few of them around when I looked (possibly one in France for £80).
At that point I started to wonder if it was another problem, for example not detecting the key or some connection issue. I was resigned to taking it to a Mazda dealership but in the end I tried an auto electrician. He came to me and had a look and quickly demonstrated that it was the obvious part, being the boot opening switch itself. He was able to close the circuit and the boot opening actioned. The switch itself was clearly water damaged and he did try a temporary repair but it was too far gone so we left it that. To be fair he charged £70 call out (SW London) and £20 for the work/inspection but I'd already stripped the tailgate to be fair. Even so relatively reasonable.
After that I took another look and found the part on ebay for £35 and got that through and all back up and running. I did add some tape to the switch inside the tailgate in an attempt to protect from any water ingress.
I don't know how much the part would be from Mazda but wouldn't be surprised if it was £100 for what is a basic part really. I did see a bunch of what must have been Chinese pattern parts on Aliexpress for around £20 but didn't fancy trying that route.
Anyway, hopefully useful info for somebody and probably best to start with the obvious part after all if you can find one! The tailgate trim was all reasonably easy to dismantle and put back together although I did need to buy a couple of trim clips that had broken.