Pre- note: For veterans, this won't be a new issue. Systematic build method would prevent it occurring in the first place. So I present this merely as anecdotal fodder for future searchers.
Situation
In the midst of doing arcade cabinet maintenance, I needed to replace a controller board which ran a cab's arcade controls. After subbing in a new controller board, I had issues with two of the joystick's diagonals not working in games. A lot of Google results regarding problematic diagonals suggested a physical problem. For example: badly aligned stick installation, or restrictor gate, or bad switch. But I knew that in my case it could not be those.
Cause found:
After troubleshooting, I located the cause: the joystick's pinout is, strangely (don'taskmewhy!), DRUL. Interleaved axes. While the controller board, is ordered in the more standard UDLR order. That is to say, paired axes. Normally, you'd expect such differences wouldn't matter - one can simply configure in software, as needed.
The problem here is that the controller board disallows what it thinks of as 'illegal' UD or LR combos. So it simply purges those. Leaving the user in an initially-confusing situation where all four of the main directions, and two of the diagonals, will seem to work perfectly fine - and the other two diagonals (corresponding to the controller board's UD + LR pin combinations), not at all!
Conclusion:
If you're having problems with your joystick diagonals after a new install, check that your joystick's pinout and your controller board's expected pinout match. Particularly in terms of how the axes are paired together. Else situations can arise where all of the individual directions will work perfectly fine, but (some of) the diagonals will not! Hope this helps somebody facing this niche situation in future.