Stroke Ending/Cap Glitch

Using strokes here with the end cap and having this strange issue where some caps are aligned vertically and others horizontally. Any way to control which direction it goes in? And why do some auto go one way and others the other way when all the paths are exact to a grid?

Thanks!

It aligns to the nearest horizontal or vertical. I suspect that it is 45° and some rounding errors push it to either side.