you need a different resistive divider system as when the 431 turns off (light to no load) it will see the full applied volts...
i.e. make sure the worst case applied volts (usually no load) to the 431 are below the rating for the particular device you are using - not all are 40V.
Regards, Orson Cart.
Currently, primary side feedback is more popular for AC-DC. You can find many this kind of IC thru websites.
No 431 needed. It is cheaper and easier for design.
a linear opto, e.g. IL300 can be used to transfer the Vout to the pri side if you have a 12V say, aux supply on the sec to power the IL300 ckt. Or you can post the current circuit and we can then see the problem. Regards, Orson Cart.