I created this question:
It was deleted, and for good reason. I had failed to provide a "minimal complete verifiable example". Sorry, I concede I was a little lazy there.
What has changed is that I've found the answer myself. And it is instructive. Rather than provide all my code I can provide the answer. I've edited the question to include the answer, but this is the wrong place for it. Can 4 people vote to undelete it and then I'll move the answer to a proper answer?