Solutions that gpt chat gave me:
Tests to Diagnose the Problem
Export your game as NW.js and enable the Node-Webkit and NW.js File System options.
Run the exported game and see if the .json or .txt files are being created.
If that doesn't work, try saving the data in LocalStorage or IndexedDB and see if they are being read correctly.
Test running the game as Administrator.