After spending 4 hours attempting to get WithRealmImport() to work when running aspire deploy, @davidfowl informed that it's not supported in production. The documentation does not state this anywhere.
Fowler and I agreed that this should be explicitly stated, and most probably in the section specifically regarding Realm importing:
https://aspire.dev/integrations/security/keycloak/#add-keycloak-resource-with-realm-import
It would also be nice if the documentation suggested alternatives on how to seed Keycloak (i.e. service or baking realm JSON into image).