How do you stop Unity from removing items from an array during runtime?

Hello! I’m having an issue with an inventory script that I’ve been working on, and I’ve just figured out that the array for the inventory is being deleted on startup. Does anyone know why this is happening?
Below are pictures of my shop code and inventory code. They use the same code, but the shop initializes normally and keeps the array filled with slots.

If you are creating an inventory system where the order of items will change, or if items will be added or removed during runtime, use a List rather than an Array.