G clef = right hand and F clef = left hand is a good rule of thumb to get beginners started. But notation is not an exact science but also an art form. Sometimes the composers will treat the grand staff as a canvas to put notes on and indicate which hands to use with beam direction, and sometimes not at all.Bach in particular notated the music in terms of what notes he wanted to be played only, and then the player had do figure out a hand distribution that was convenient for them. In most cases it is reasonably obvious what works best.
The following is the fourth bar in Goldberg Variation No.1, which seems impossible to play according to the above (due to the span from the F# to the bottom D), and breaking that "rule" seems obvious, especially as the movement is written in two parts each playing a single note throughout, so the chords would seem out of place.
I think your question has been thoroughly answered, but to belabor this specific point, I have seen at least once person rewrite (or maybe just rethink) that particular spot in the Var. 1 (§A) where the hands cross in a way that there's no hand-crossing. I don't have a link or anything, just something I saw once.However, I don't know if I've ever seen anyone do it otherwise than crossing hands, and I never questioned it as a kid learning some of these. Although I admit it's trickier if you try this very quickly indeed, more like the first studio recording of Gould: I have to roll up my sleeves to not get accidentally caught by loose fabric!It's not exactly just in Bach where one sometimes has to figure out divisions between the hands: sometimes you'll see in scores "supra" or a similar notation indicating which hand is meant (maybe by the editor, or possibly the composer) to go on top when the hands are right on top of each other alternating notes.Fortunately in Bach's case, there are so many different student editions which have slightly different visual indications of how the editor envisions playing a given passage (whether by giving fingerings above or below the note, or putting things in different clefs and so on) that it can be rewarding to compare these different editions and decide for yourself what's easiest for your hands and perhaps sensibilities.