Tiles suddenly invisible

After a while most tiles don’t render at all. It only happens after a certain amount of tiles are placed, because when I delete some tiles during the process of the tiles being generated, they are visible.
Whats also weird is that the ores are not invisible, even though they are generated after everything else.

So Unity finally responded to my bug report.
Apparently, a tilemap can’t render more than 65535 colors.
My script changed the brightness of every tile with this variable:

float rd = UnityEngine.Random.Range(0.0f, 0.1f);

Though this creates infinite colors, so instead you have to use this:

float rd = UnityEngine.Random.Range(0, 99) * 0.001f;

This can only generate up to 99 colors.