The reason for this might be that the course organizers of these two courses prioritized you and your colleague in the opposite way. Since also the course organizers' preferences are taken into account for the matching, such situations may occur.
If you still think something went wrong with the assignment, please contact