GROMACS installation through Homebrew error

GROMACS version: 2021
GROMACS modification: No

I installed the latest version of Homebrew, through which I tried to install GROMACS (command: brew install gromacs). However, when I try to run any GROMACS command I get the following error:

dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libgomp.1.dylib
Referenced from: /usr/local/bin/gmx
Reason: image not found

I noticed my gcc version was 11.1 and the path seemed to suggest using gcc 10, so I installed gcc 10 and changed the file paths to match the error. However, I am still getting the same message. Does anyone know a fix to this?