Oh, that might actually be the reason I never noticed (most of my computers are old enough to use BIOS).
The link to askUbuntu suggests using another tool that should work with UEFI, perhaps that's worth a try.
There was recently another thread where a user having similar problems found out that the issue was hardware related (link below). I mention this as a possibility since both Firefox and VSCode may be writing too often to disk and thus causing the problem. Although I must admit at this point I'm all out of ideas and just guessing...