PG2 GPIO output on Nucleo-F767ZI doesn't function
I don't see any obvious reason.  The Nucleo board doesn't seem to be doing anything special with those pins.

Each of these specific pins have a couple of alternate functions.  Are you using the FMC module? Or might you have PG2 configured as an EVENTOUT signal?



Another idea is that the output driver is fried for that pin.  When you used the second Nucleo (without attaching your custom board), was it "fresh" or might they both have been similarly damaged in the past?