The STM32U575, in some packages (UFBGA132 and UFBGA169), the built-in OPAMPa, besides the standard input pins shared with other functions through GPIO, for the inverting output they have also a dedicated input pin (OPAMPx_VINM), with significantly lower input leakage than the standard GPIO pins (7nA at 75°C vs. 500nA).
User Tomas Hamouz reported, that after setting OPAMP2 to use the dedicated OPAMP2_VINM pin at M2 ball of the UFBGA132 STM32U575QII, OPAMP2 does not work (while after setting it to use the respective "standard" GPIO pin at PA7 works as expected).
User mads_nielsen discovered, that the dedicated OPAMP2_VINM pin does work, but only if PA7 is set to Analog in GPIO_MODER.
This is probably an error in the hardware design, as the manual/datasheet does not mention such requirement. As PA7 has multiple non-Analog functionalities, it is quite likely that users may want to use in that way in the BGA packages, while using the dedicated OPAMP2_VINM pin for OPAMP2, leading to the problematic combination.