I ran into this issue as well (more than once).
A Task accidentally kept self alive, which I didn't intent.
As a workaround I added this to my codebase, so that I never accidentally get the implicit self:
extension Task where Failure == Never {
/// This wraps Task.init, but it doesn't have `@_implicitSelfCapture`, because it cause bugs where self was kept alive too long.
@discardableResult
internal init(@_inheritActorContext operation: sending @escaping @isolated(any) () async -> Success) {
self.init(priority: nil, operation: operation)
}
}