I believe you will need to perform another clean install of macOS in order to reclaim that free space. I don't believe Disk Utility will allow merging of free space into another Container/partition if that free space is located in front of the Container/partition.
Besides the traditional method of a clean install, 2018+ Macs have a firmware "Restore" option which will properly prepare the Mac's internal SSD for macOS. With an Apple Silicon Mac which you appear to have here, the firmware "Restore" option will also push a clean copy of macOS onto the internal SSD. This is the easiest & best option as long as you have access to another Mac running macOS 12.4.
Revive or restore a Mac with Apple silicon using Apple Configurator - Apple Support
Traditional method of reinstalling macOS (read the section for "erase your disk" for a clean install):
How to reinstall macOS - Apple Support
FYI, do not touch the other Containers labeled "disk0s1" and "disk0s3" since they are required by an Apple Silicon Mac. If these are deleted, then One True Recovery (1TR) will no longer work & the Apple Silicon Mac will no longer boot which will force you to perform a firmware "Restore".