Hello, my theory behind this issue is dust in the first place, and by changing and replacing the DIMMs you had to move your laptop upside-down multiple times which might cleared the dust and the memtest86 was just a lucky step.
If this happen again, don’t move your computer, try to run it normally multiple times to make sure the problem happen at 100% and then run a memory test, if it works then it’s a software issue if not then it’s a hardware.