The locking lugs/block are different.
The G19/26 share the same locking lugs/block. You can put a G19 barrel in a G26. Probably the complete slide, too, but with a gap in the dust cover. Not 100% positive on that, so don't take my word for it.
The G35/17/17L share the same locking lugs/block/frame.
You can't put a G17/35/17L barrel or slide on a G19 or G26/27. It would fit, but the barrel lugs wouldn't fit the locking block, correctly. IIRC, I read about someone who tried it, and the slide locked back after the first shot, and it needed to be hammered loose.