I'm not sure what the issue was, but going back to Flutter 3.24.0 fixed the red screen. It's possible that a newer version might also work.