SMPS test circuit PWM controller not switching the MOSFET
Just a quick  idea of what I would do.

Replace all of your components in the Drain circuit with a single resistor.
Maybe something that would allow 100ma to flow from the 317 v circuit.
Check the Drain circuit with a scope when you are driving Gate with Sq wave.
Does Drain look right?   Square wave?  Is there much ripple on the 317 v supply?

Then I would reduce that resistor and draw more current and try again.
Does it look right?   Square wave?  Is there much ripple on the 317 v supply?