Diagnosing SQLAlchemy DetachedInstanceError: Session Scope, Expiration, and Eager Loading
DetachedInstanceError means the object lost its Session and the attribute was never loaded. Use inspect() to confirm, then fix session scope or loading strategy.