>> 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

hit me up in https://www.linkedin.com/in/javiermu%C3%B1oz/