I can see this being due to one or more of several reasons ...
keyboard physical issue or failure, which can only really be solved by replacement.
Mechanical issue with the specific key. In general use a keyboard takes a lot of "abuse" and can fail, it can also have an issue with detritus, between/underneath the key that prevents it travelling to the full extent and thus giving random key press codes to the OS, [Some years ago I was called into a company accounts department as one of their keyboards was not working, the enter key in particular, so I replaced out the keyboard and checked the faulty one back in my office/lab - there was a whole half a peanut wedged under the enter key

how it got there is still a mystery
A software issue there are software packages that can remap the key function, there is one built into the OS, to aid those with physical disability issues, and these may be switched on accidently as they use strange key combinations for the switch, so check the accessibility settings of your system, there are also others that may be given as gifts with other software.
Malware Issue Malware may sometimes, intentionally or not, cause keys to produce the incorrect output, so it's worthwhile running a malware scan.
As has been stated, a temporary replacement keyboard may point to the possible cause as a mechanical issue would disappear whilst a software one would not