Calling AssetDatabase.Refresh() during OnEnable() is not supported and we have no plans to invest the time necessary to support it any time soon.
You can possibly use a delayed call (https://docs.unity3d.com/ScriptReference/EditorApplication-delayCall.html) if it's important for you to invoke this method in OnEnable, but this is a heavy call to make and I would rather advise making it happen on user input rather than automatically.