Did iOS 17.2 break zIndex?

I am following the Spring 2023 Stanford iOS programming class. In the Memorize game, we add a FlyingNumber as an overlay above a card which resulted in a score change and animate the number up or down depending on positive or negative score change. The instructor sets zIndex to 1 or 0 depending on whether that card caused the score change. The intent is to ensure that the FlyingNumber is above all the other cards being displayed. This works in iOS 17.0, but in iOS 17.2, if the FlyingNumber is negative it slides under the cards below it in the grid. The behavior in iOS 17.2 is as if the .zIndex modifier is not present.

private var cards: some View {
  AspectVGrid(game.cards, aspectRatio: Constants.aspectRatio) { card in
     if isDealt(card) {
        CardView(card, gradient: game.gradient)
           .matchedGeometryEffect(id: card.id, in: dealingNamespace)
           .transition(.asymmetric(insertion: .identity, removal: .identity))
            .padding(4)
            .overlay(FlyingNumber(number: scoreChange(causedBy: card)))
            .zIndex(scoreChange(causedBy: card) != 0 ? 1 : 0)
            .onTapGesture {
                choose(card)
          }
       }
    }
 }

If there is no parent ZStack then the .zIndex modifier is ineffective.

Thanks. I have tried wrapping cards within a ZStack but that makes no difference. Also, I don't immediately see how that would explain that it works properly in iOS 17.0 but not iOS 17.2.

In CS193P lecture at 20:15 - 23:00 you can see zindex in action under IOS 16. Does not work on 17 or 18 even if LazyVGrid is wrapped in ZStack. Professor Ruben is a Swift Aficionado and this is his code. Lecture: https://www.youtube.com/watch?v=RCwmYEis5nA Source: https://web.stanford.edu/class/cs193p/Spring2023/MemorizeL9.zip

Did iOS 17.2 break zIndex?
 
 
Q