Bit late but I had the same issue and it was fixed by just removing Optifine. If it still occurs after that, try removing the fabric API and or sodium.
@dyiing Thanks for the last recommendation. I deleted the "1.19 Aristois" Executable Jar File in my "1.19 Aristois" version folder and then ran up minecraft. It launched without the same error. Appreciate it.