>> I guess it depends on pin layout or similar?
You guessed right.
- download cubeMX,
- open a new project with your STM32G071RB(your package digit is missing) mcu, File->New
- press Alt+L, enjoy the list of compatible mcus.
for example: STM32G071RBIx
Available for consulting/freelancing , hit me up in https://github.com/javiBajoCero