C9 youtube internal error 500 on localhost

Hello, I am using latest versoin of concrete (9.2.1) and php 8.2. I have it installed on my local macbook in MAMP.

When I am building my site on localhost, it works well, except I cannot get the youtube videos to appear using the youtube plugin. In safari, they just show a blank block area, and in chrome, it shows a youtube error.

If I inspect the page, it shows an internal 500 server error, but if I paste the youtube url directly into my browser (not in localhost concrete 9 block) it will work.

Any idea what this could be?