Ribbon cable is intended to connect topside to topside like this...
1 2 1 2
3 4 3 4
5 6 5 6
7 8 7 8
9 10 9 10
...but your system's boards have one connector on top and mating connector on bottom. In the photo, one of the boards is flipped over 180 degrees, showing the connector that is on the bottom of the board. The bottom connector is wired up as a mirror image of the top connector, but the straight ribbon cable is wired as straight translation. What you have now is like this:
1 2 2 1
3 4 4 3
5 6 6 5
7 8 8 7
9 10 10 9
So the odd numbered pins on one board are going to the even numbered pins on the other board.
One way to fix this is with a pair of right-angle headers, 90 degrees + 90 degrees = 180 degrees. This will swap the even/odd pins again. Alternatively, you could unzip the ribbon cable wires and manually swap them, but that's quite prone to error.
Update: As suggested in the comments, a 180 degrees mirror image can be achieved by using a M-M straight pin header, with one ribbon cable plugged into the "top" and the other plugged into the "bottom".
Since it's hard to explain this configuration in words, here is a 3-dimensional model:
Original board to board connection is modeled here in yellow, with pin 1 designated by the blue bricks. One connector is on the top of the bottom board, and the other connector is on the bottom of the top board.
Ribbon cable connection is modeled here in red. There are two ways to connect the ribbon cable, both of them incorrect. Ribbon cable is meant to connect topside to topside, and when the top board is flipped over, the resulting connection is swapped odd/even rows or else it is swapped low pin numbers/high pin numbers (but correct even/odd). Both configurations are misaligned.
For what it's worth, I've been burned several times by this kind of problem during my career; I now require that every board-to-board interconnect has to have a master 'system drawing' showing exactly where pin 1 is located -- sometimes pin 1 on one connector on one board ends up being a different pin number on the other board. Hope this helps you work through the details of getting your system connected.