I am confused as to why 他们的朋友在右边 would be wrong.
You are saying their friend is on the right... On the right of what?
That would mean Their friend is on the right side (or plural).
Your sentences would be translated as: Their friends is on the right side.
'Their' in the question (The friend is on their right side) is refer to 'right side', not 'friends'. So it would be 朋友在他们的右边
That sentence means their friend is on their side. It shouldn't specify who's friend it is.
You're saying 'Their friend is on the right', the sentence is essentially saying 'The friend is on the right in relation to them' (i.e. On their right)