I agree that there's likely some heath problem that a vet should diagnose, but one extraneous variable that plays into feeding problems is providing UVB for those species that don't need it (and even sometimes in those that do need it). Captive UVB contributes to feeding issues in a range of species, and so troubleshooting might include removing the UVB to see if there is change in the situation.
If the snake is using the UVB as a heat source, well that's a complete no-go. Animals that are forced to accept something detrimental because it goes along with something they're seeking will often choose to harm themselves.