See some of the configurations in the associated answerhub:
https://answers.unrealengine.com/questions/710975/material-static-switch-broken-in-nested-functions.html
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-50878 in the post.