Baked lightmaps broken in mobile

I am making a game with different levels. Each level is an additive scene having 2 sets of lightmaps, Day version and Night version. LightmapSettings will be updated after the scene is loaded.

[System.Serializable]
public class LightmapTextures
{
    public Texture2D[] lights;
    public Texture2D[] dirs;
    public Texture2D[] shadows;
}

public class LightmapSwitch : MonoBehaviour
{
   
    public LightmapTextures[] lightmaps;

    public void SetLightMap(int index)
    {
        LightmapTextures lightmapTextures = lightmaps[1 - index];   // Setting mistake
        LightmapData[] lightmapData = new LightmapData[lightmapTextures.lights.Length];

        for(int i = 0; i < lightmapTextures.lights.Length; i++)
        {
            lightmapData[i] = new LightmapData();
            lightmapData[i].lightmapColor = lightmapTextures.lights[i];
            lightmapData[i].lightmapDir = lightmapTextures.dirs[i];
            if (i < lightmapTextures.shadows.Length)
            {
                lightmapData[i].shadowMask = lightmapTextures.shadows[i];
            }
           
        }
       
        LightmapSettings.lightmaps = lightmapData;
    }
}

It works fine in the editor. When I build on Android, the lightmaps looks well in the beginning. But after some levels, the lightmaps will be broken until I restart the app.

Is there any setting mistake from my codes or my maps? Or is it caused by caching or out of memories?

@kk3hi3123

Interestingly, this problem happens on Unreal Engine, and other game engines too, when you put/build game that has lightmaps, onto mobile. The fact that this problem occurs on other game engines is interesting, and shows this is not just a Unity game engine problem.

Okay. Change or toy around with the compression settings, and see if that works.

Strangely enough, I always had a suspicion, that this might be, some sort of mobile gpu rendering, gpu memory, or RAM bug.:face_with_spiral_eyes: