Error creating a macOS Big Sur bootable installer
I am trying to create a bootable installer for macOS Big Sur on an M1 MacBook Air to use on a 2016 MacBook Air that cannot reinstall macOS in recovery mode. I have a 32GB flash drive that I am trying to make into a bootable installer and I have downloaded the macOS Big Sur installer, but when I try to use terminal to complete the process, I get an error that I haven't found a working solution to online. I have tried multiple times but keep getting the same error:
Erasing disk: 0%... 10%... 20%... 30%... 100%
Copying to disk: 0%...
Error: Error Domain=NSCocoaErrorDomain Code=512 "“MacOS” couldn’t be copied to “Contents”." UserInfo={NSSourceFilePathErrorKey=/Applications/Install macOS Big Sur.app/Contents/PlugIns/IA.bundle/Contents/MacOS, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/Volumes/Install macOS Big Sur/Install macOS Big Sur.app/Contents/PlugIns/IA.bundle/Contents/MacOS, NSFilePath=/Applications/Install macOS Big Sur.app/Contents/PlugIns/IA.bundle/Contents/MacOS, NSUnderlyingError=0x6000021fc570 {Error Domain=NSPOSIXErrorDomain Code=22 "Invalid argument"}}The copy of the installer app failed.
I have tried using the flash drive as both ExFAT and Mac OS Extended (Journaled), both times in GUID Partition Map Scheme. The MacBook I am creating the installer on came with Big Sur preinstalled, so it should be able to create an installer for it. I would appreciate any help as to how to get the flash drive into a working installer for Big Sur because the 2016 MacBook Air is unusable until I can reinstall macOS on it.
MacBook Air