Looks like you have leakage around the transistor. Did you clean off the flux ? That area needs to be clean !
I didn't because the flux described itself as "no-clean flux" and claims to meet SF-818 for surface insulation resistance what ever that is.
Probably I should have (though it all looks very clean anyway). This was my first ever bit of smd soldering and use of a flux pen so it
has been a bit of a learning curve. Initially no flux came out of the pen at all, but then I actually read the instructions and found you
need to press it down on the point/knib to start the flow!
I'll clean it up with a bit of IPA, though now I have the extra 10M in there it won't make any difference to the behaviour except perhaps
to increase the frequency from 40kHz if it gets rid of the leakage.
The extra leakage mattered when it was preventing the capacitor charging to above 35V, but once avalanche is reached having approximately
5M in parallel presumably is neither here nor there. With the 5M resistance, even with the leakage it should be able to reach avalanche voltages up to
around 55V.
Thanks for the advice, and all the work you put into this project - I am having a lot of fun with it.