I guess if the y velocity of an object is positive then it’s falling. Since it’s a stack and you don’t want to consider the one you’re placing on top you could pick all the falling apples and if there are more than one, you could consider the stack falling.
A first iteration of the idea could be something like this:
Pick by comparison: apple: apple.physics.velocityY>0
Conpare: apple.pickedCount>1
— set falling to true
If comparing by 0 gives too many false positives you could use a higher number.
There may be ways to make it more rigorous. Maybe if you looked at the total speed of each apple and if more than one were increasing in speed then you may be able to detect the stack tipping before it actually starts falling.
Another idea is to just count the number of apples on the ground. However, that would only detect that the stack already fell.