unrecognized selector sent to instance

When trying the code from this Session: https://developer.apple.com/videos/play/wwdc2023/10176/ Specifically:


result.generateScaledMaskForImage(forInstances: result.allInstances, from: handler)  

It throws the error:

-[VNInstanceMaskObservation generateScaledMaskForImageForInstances:fromRequestHandler:error:]: unrecognized selector sent to instance

Any ideas?