If someone does this as you have mentioned, Finally, we can extract the LCP and RCP components in S21_L and S21_R:
S21_LR = (S21_R(:,1) + 1i*S21_R(:,2))/sqrt(2); # RCP input --> LCP output
S21_RR = (S21_R(:,1) - 1i*S21_R(:,2))/sqrt(2); # RCP input --> RCP output
S21_LL = (S21_L(:,1) + 1i*S21_L(:,2))/sqrt(2); # LCP input --> LCP output
S21_RL = (S21_L(:,1) - 1i*S21_L(:,2))/sqrt(2); # LCP input --> RCP output

Isn't S21_LR the same as S21_RR if we take abs(S21_LR)^2. Just +i and -i. Similarly, it is valid for LCP input. How are the transmission coefficients correct? Please reply. I am facing the same issues