I also have this problem once or twice a week. I agree it is more likely to occur when I close & restart MC quickly.
I have noticed that when the instance without a loaded CustomKeymappings.xml is closed, it does not overwrite my (correct) CustomKeymappings.xml.
So a restart (or three) of the program eventually reads and loads the correct CustomKeymappings.xml
@total_annihilation00, what antivirus do you use?