We show that a Gorenstein subcanonical codimension 3 subscheme Z⊂X=ℙN, N≥4, can be realized as the locus along which two Lagrangian subbundles of a twisted orthogonal bundle meet degenerately and conversely. We extend this result to singular Z and all quasi-projective ambient schemes X under the necessary hypothesis that Z is strongly subcanonical in a sense defined below. A central point is that a pair of Lagrangian subbundles can be transformed locally into an alternating map. In the local case our structure theorem reduces to that of D. Buchsbaum and D. Eisenbud  and says that Z is Pfaffian.
We also prove codimension 1 symmetric and skew-symmetric analogues of our structure theorems.
"Lagrangian subbundles and codimension 3 subcanonical subschemes." Duke Math. J. 107 (3) 427 - 467, 15 April 2001. https://doi.org/10.1215/S0012-7094-01-10731-X