What Aaron said... and then there is the fact that you are asking to do something very computationally intensive on a thermally throttled (ie lower- performance) system
you can do 240fps, of a small resolution canvas (ie less bits to process)... which is bound to NOT be what you are after
Basically you are asking the equivalent of competing at a drag race in a moped (or pacing a SR-71 with a turbo-prop)
In this case, you are using free, open-source software, written originally for x86 with lots of power and flexibility, recently ported to a brand new CPU platform, asking for (switching to other motorsport analogy) Formula 1 level performance. The situation is complicated by fanboys who have oversold the performance of the M2 chip. The M2 is very good at certain things, but not everything. And a key design focus for the M2 was battery efficiency, not outright power. At this point, certain functions perform well (ie stay within the walled garden). But you are stepping outside that garden with this request
So basically, wrong tool for the (high-end real-time video encoding) job. And is it even possible to encode 240fps on a M2 laptop when screen can't produce that ... so is CPU/GPU even creating all those frames in first place (ie, that many frames for OBS Studio to capture)?
Folks make such OBS Studio configs seem simple, but technically video compositing is complicated. And like most things, when you really want to push the envelope of performance (more than 60fps), it quickly gets expensive and tricky, the bleeding edge, so-to-speak. That doesn't mean impossible, but it does mean a whole lot of research, optimization, adjustments, and possibly, budget for custom code (and maybe even a small development team, test systems, etc) to pull something off. The M2 isn't my area of expertise... so no idea if 240fps is possible/practical at all on your system.
Start with no more than your screen refresh rate (ie if 60MHz screen refresh, don't go higher than 60fps to start... and even then.. on a M2 Macbook Air...??)