SwiftData predicate with optional chaining failing on OS 27

The following predicate (which returns results on OS 26) only returns results on OS 27 when I comment out the last line:

reviewDescriptor = FetchDescriptor<Flashcard>(
    predicate: #Predicate {
        $0.sourceLanguageRaw == rawLang &&
        $0.cardStateRaw == reviewRaw &&
        $0.dueDate < currentDate &&
        !$0.isSuspended &&
        advancedStudyEnabled.evaluate($0) &&
        !($0.promotionLog?.isProcessing ?? false) // <- here
    },
    sortBy: [SortDescriptor(\.previousInterval)]
)

// where Flashcard — PromotionLog is a one-to-one optional relationship

Because I’m still getting results on OS 26 from the same data, my guess is the line with optional chaining somehow causes the entire predicate to fail silently, without crashing the app. But I also don’t see any posts about it, so maybe it’s something I’m doing wrong?

Is anyone else experiencing this? Any workarounds?

ETA:

However, this chaining appears to be working just fine:

reviewDescriptor.predicate = #Predicate<Flashcard> {
    $0.sourceLanguageRaw == rawLang &&
    $0.cardStateRaw == reviewRaw &&
    ($0.pronunciationLog?.dueDate ?? currentDate) < currentDate &&
    $0.pronunciationLog?.practiceStateRaw != masteredRaw &&
    !$0.isSuspended
}

So I’m a bit lost. Maybe the syntax of the first? Something about using it alongside .evaluate()?

ETA2:

After a bit more debugging, when && !($0.promotionLog?.isProcessing ?? false) is commented out, a Flashcard where promotionLog == nil shows up. But if promotionLog == nil, the line should evaluate to !(false), i.e. true. So why would that line stop the card from showing up in the first place?

SwiftData predicate with optional chaining failing on OS 27
 
 
Q