Why is findSet() called twice in the Pairing Problem

In the lecture DSU 08 - Pairing Problem, inside the
unionByRank() function, Prateek bhaiya has called the findSet() function for the 2 input vertices x and y.
However, at the instance of calling the unionByRank() function (in the main() function), we had already found the set in which x and y belonged, so why are we calling it here again?

The reason for asking this doubt is, consider the following solution for the Pairing Problem

Now, on lines 34 and 35, we are calling the findSet() function, but, on lines 59 and 61 we had already calculated them and then passed to our function.

If we submit this code, we get a successful submission.
However, if we comment out the lines 34 and 35, we get an Incorrect Submission on Test Cases 2,3 and 5

I cannot understand the significance of writing the 2 lines of code again (i.e 34 and 35), please help me in understanding the same.

@devpratik,
Check this out, Code.