If you’re deleting the material function outside of UE, like through version control or Windows Explorer, then it would explain this behavior.
An asset’s list of dependencies is saved into the asset itself when you save it. If you delete any of the other assets it depends on without resaving the asset itself, then its dependency list will remain unchanged.
In my case, I was removing the material function from the Material and then saving it, updating its dependencies list, which is why it worked for me. If you are deleting the material function asset itself, especially outside of UE, and expecting other assets who depend on it to update themselves, then that’s not how it works in UE. That’s why resaving the packages is fixing it in your case.
I will also mention that deleting assets while other assets are still depending on them, especially outside of UE, can in some cases produce crashes. It’s best to first make sure that you have removed all references to an asset before deleting it.