Almost without a doubt if the keyboard has been extensively used then a replacement should fix the problem. Try an external USB keyboard and if all works well then that is the sure indicator of a bad keyboard. You can find those keyboards at Parts-People here.
XPS 15 9500, Shipped on Jun 8, 2020  I've recently (within the past few months) noticed that some of my keys sometimes don't work, this would involve anything from having to retype a word to the key not being responsive at all for several minutes. The keys mainly affected are the following: e, w, d, 2, 3, r, and the volume keys. I have also noticed the keys being more unresponsive at higher temperatures, though this is not always the case.   This is probably a cause of daily usage of the keys, which means I'll most likely have to replace it. The keyboard never came into contact with water/crumbs, but then again, I have never cleaned the underside of my keys.
XPS 15 Keyboard Issue