You have Matlab2023b (Apple silicon), right?
Unfortunately, the OpenMEEG team has not produced a release for Apple Silicon architecture.
One thing you could try is to install Matlab2023b (Intel processor), or any earlier Matlab. Then Matlab will run with Rosetta 2. Once installed compute the head model with OpenMEEG. I will not be able to test this setup until next week. If you try this approach please post your results.