that Samsung Odyssey G7 28" 4K appear to be:
3,840 x 2,160 resolution with High Dynamic Range - billion of colors, 10-bits/color
interfaces include:
HDMi 2.1 x2
Displayport 1.4
there are a number of potential weak points in that connection.
Your M2 MacBook Pro with PRO processor CAN use HDMI 2.1 to attain high resolutions, but only under certain conditions.
'Cables in good condition' is good, but there are many types of HDMI cables, and the standard bodies have been AWFUL about making clear what is required.
To make this connection, you MUST be using an HDMI 2.1 Certified cable, labeled ULTRA. (backward-compatible with older versions). Cables should short, around one meter is preferred but not required.
if you use an older PREMIUM cable, you can just make 4K at 60 Hz with HDR=OFF (8 bits/color). with HDR on, 50 Hz is the best that can be expected to be reliable, with compromising colors.
With the correct ULTRA cable, 144 Hz refresh rates are attainable and should be stable.