I don't have a GoPro 12, so I can't confirm its compatibility.
GoPro Hero12 Black has external dimensions of 72 x 51 x 34 mm (2.83 x 2 x 1.32?) and weighs 154 g (including batteries). GoPro Hero11 Black has external dimensions of 71 x 55 x 34 mm (2.8 x 2.17 x 1.34″) and weighs 127 g (including batteries).