The issue I am having is that at some point, randomly, the pixel data I generate and assign to an image disappears. This usually happens after several large images and pixel data have been created. The images remain, but they are black. If I restart the blend file after saving, they will also turn black. It is almost as if the data I create is freed, same as if I was to use this function:
my_image.buffers_free()
I generate a new image this way:
my_image = bpy.data.images.new(name="new_image", width=1024, height=1024, alpha=True, float_buffer=True)
my_image.pixels = new_pixels