For eg:
I paid for the total 16000
Friend A needs to leave early and left some amount say 4000 to Friend B.
Friend A owns 3500 to me, he left 4000 to Friend B.
Friend B also owns 3500.
Now Friend B will compensate for both him and Friend A.
There is no way to track that specific transaction between Friend A and B, without making it a work around from choosing different unrelated categories.