Algebraic geometry of the Lagrangian correspondence of Gaiotto