Texture2D is gray until it is added to AssetDatabase?

In a recent project, I stumbled upon some strange beahviour in Unity 2021.3.6f1. When I create and pass around a Texture2D, it appears gray in the Inspector and on any objects I apply the texture to. However, this is resolved as soon as I use AssetDatabase.Delete(path) and AssetDatabase.Create(tex, path) on the texture. Obviously this isn’t the preferable solution since this operation is very slow and does not work in a finished executable. Is it possible to force the texture to “reload” perhaps?

In case anyone has the same issue, you might need to call Apply() on the texture after making any changes to it.