Sonoma bug? gradient drawInBezierPath to dataWithPDFInsideRect results in Gray box

I'm drawing a colored gradient inside a rectangular Bezier curve within a custom View's drawRect method using drawInBezierPath. When I convert the view to a PDF using drawInBezierPath, the gradient is replaced with gray. Is this a bug, or am I doing something wrong?

Thanks!

Sonoma bug? gradient drawInBezierPath to dataWithPDFInsideRect results in Gray box
 
 
Q