Resolved! COMP2 don't work with STM32G071KB (QFP32 pin package) with port pin PB4
I tested 2 sample with no connection of COMP2 with port pin PB4. If I set INPSEL to 01=PB6 or 11=PA3 the comperator works! (INMSEL 0011= Vrefint) The ST Support told me that a Nucleo-64 board (LQFP64 package) would work. For the QFP32 they dont' ...