The solution is very simple: Just uninstall Razer Synapse completely.
Everything works perfectly since this uninstallation.
This is the only solution to the problem which is purely a software problem.
The community has been complaining about this problem of ghost keys for years without any change made to the software by Razer. This makes their products simply unusable.