I have encountered a very similar problem on my end.
Since updating to Playgrounds version 4.2.1 (from 4.0) neither the old Playgrounds "Learn to code 1", "Learn to code 2" nor a current one like "Get Started with Apps" work.
I am also able to run Swift based apps in Xcode.
I have tried reinstalling Playgrounds, reinstalling Xcode. All without success. I also contacted Apple support (chat), but they couldn't help me. They suggested me to reinstall Playgrounds.
Mac OS 13.1
Xcode: 14.2
Playgrounds: 4.2.1
This is what the error message looks like when I run an "old" Playground (e. g. "Learn to Code 1").
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: