Where does the game get the Unstable Rate value in osu!catch?

Short answer

The game calculates the Unstable Rate from the position of the notes' (or fruits') position upon being caught by the player (or catcher).

Long answer

The player / catcher, marked with "hit errors"

The notes (or fruits, will call them notes from now on) will land on the player and the game will record the position of the note based on far off the center is the note on the player.

This mechanic closely resembles the timing calculation on the other game modes, but by actually using the timing on how early/late the player hits a note. See this image of the Error meter for reference:

hit error meter

Testing

To see how this works, I've done some tests. I found a beatmap where all the notes are in the same place and played it.

As expected, since the notes doesn't move at all (I just stayed on one spot the entire time), I got 0 Unstable rate and 0ms Error:

All 0s in UR and error

I replayed the map a couple more times but this time moving to the left or to the right and not move at all and got these results:

enter image description here

It looks like the game treats left as a late hit (+ms) and the right as an early hit (-ms).

And finally alternating left and right between the notes:

Varied UR and error

Conclusion

The game treats the notes as "hits"" and treats the top of the player as a tape of timed points and basing the position of the notes on the player as a "timing" point. Which can be visualized as:

Visualization