While learning this piece I encountered this line connecting two notes between the different clefs. I’ve never seen it before but my best guess is that maybe it’s showing a change in the voice between the two clefs. Any help would be appreciated.
Like you said, it's just an indication that the voice is changing between the two clefs (F in the bass clef to D in the treble clef). These kind of lines are common when the author wants to show you how the voice is moving between clefs, when there is no beam to connect them (like the two previous notes in your example).
The line also makes it clearer that the two notes connected with the line should be played with the same hand (the left hand in this case)...although if your right hand can span a 10th, you can use your right hand for both of the last notes in the upper staff (the F above High C and the D above Middle C) while still following the fingering.
Another technical point: the F on the left side of the line is doing double duty as part of the middle voice and part of the lower accompaniment. This creates a bit of difficulty, as you have to repeat that F on the third beat in the accompaniment, while holding it as part of the middle voice. The line is there in part to call that to the performer's attention.
To make that happen, you have to sort of "fake" it, holding the F a little longer than the lower notes in the accompaniment, playing it a little louder perhaps so it will stand out from the lower notes, and using the pedal artfully to give the impression that the note is being held while still managing to make the F on the third beat heard. Of course, you can't do all these things perfectly, but it is possible to communicate the musical intent if you keep the music in mind.