Mac M1 SDL crash when creating a new window

SDL seems to be totally failing on my new M1 (12.2.1) when doing native builds. Here is a call stack from a crash when trying to create a new window. I’m familiar with macOS development and this crash makes no sense to me.

Any ideas how this can debugged?

CFNumberCreate (@CFNumberCreate:114)
-[NSPlaceholderNumber initWithDouble:] (@-[NSPlaceholderNumber initWithDouble:]:18)
+[CALayer defaultValueForKey:] (@+[CALayer defaultValueForKey:]:232)
classDescription_locked(objc_class*) (@classDescription_locked(objc_class*):802)
classDescription_locked(objc_class*) (@classDescription_locked(objc_class*):83)
classDescription_locked(objc_class*) (@classDescription_locked(objc_class*):83)
classDescription(objc_class*) (@classDescription(objc_class*):64)
CA::Layer::class_state(objc_class*) (@CA::Layer::class_state(objc_class*):29)
-[CALayer init] (@-[CALayer init]:29)
+[CALayer layer] (@+[CALayer layer]:7)
-[NSView(NSPrivateLayerSupport) _createLayer] (@-[NSView(NSPrivateLayerSupport) _createLayer]:12)
-[NSView _createLayerAndInitialize] (@-[NSView _createLayerAndInitialize]:15)
-[NSView _updateLayerBackedness] (@-[NSView _updateLayerBackedness]:189)
-[NSView didChangeValueForKey:] (@-[NSView didChangeValueForKey:]:21)
-[NSTitlebarContainerView initWithFrame:] (@-[NSTitlebarContainerView initWithFrame:]:27)
__49-[NSThemeFrame _floatTitlebarAndToolbarFromInit:]_block_invoke (@__49-[NSThemeFrame _floatTitlebarAndToolbarFromInit:]_block_invoke:38)
+[NSAnimationContext runAnimationGroup:] (@+[NSAnimationContext runAnimationGroup:]:21)
-[NSThemeFrame _floatTitlebarAndToolbarFromInit:] (@-[NSThemeFrame _floatTitlebarAndToolbarFromInit:]:35)
-[NSThemeFrame initWithFrame:styleMask:owner:] (@-[NSThemeFrame initWithFrame:styleMask:owner:]:62)
-[NSWindow _commonInitFrame:styleMask:backing:defer:] (@-[NSWindow _commonInitFrame:styleMask:backing:defer:]:168)
-[NSWindow _initContent:styleMask:backing:defer:contentView:] (@-[NSWindow _initContent:styleMask:backing:defer:contentView:]:199)
-[NSWindow initWithContentRect:styleMask:backing:defer:] (@-[NSWindow initWithContentRect:styleMask:backing:defer:]:17)
-[NSWindow initWithContentRect:styleMask:backing:defer:screen:] (@-[NSWindow initWithContentRect:styleMask:backing:defer:screen:]:11)
Cocoa_CreateWindow (/Users/ryanjoseph/Developer/SDL2/src/video/cocoa/SDL_cocoawindow.m:1698)
SDL_CreateWindow_REAL (/Users/ryanjoseph/Developer/SDL2/src/video/SDL_video.c:1718)
SDL_CreateWindow (/Users/ryanjoseph/Developer/SDL2/src/dynapi/SDL_dynapi_procs.h:542)
::SETUPCANVAS(LONGINT, LONGINT, TEVENTCALLBACK, TCANVASOPTIONS) (/Users/ryanjoseph/Developer/Projects/FPC/GLCanvas/GLCanvas.pas:1441)
::PASCALMAIN() (/Users/ryanjoseph/Developer/Projects/FPC/MacOSGUI/tests/tgui4.pas:119)
FPC_SysEntry (@FPC_SysEntry:10)
FPC_SYSTEMMAIN (@FPC_SYSTEMMAIN:15)
main (@main:13)
start (@start:133)