change to:
from fastapi import FastAPI
from asgi_correlation_id import CorrelationIdMiddleware
fastapi_app = FastAPI()
app = CorrelationIdMiddleware(fastapi_app)
I think this aligns better with expected behaviour (imo not returning correlation id on 500s is no expected).
I see you have a section to alleviate this behaviour but I think it should be default behaviour - also it feels a little cleaner just applying it once and not having to replicate the logic in a exc handler