I'll bet that is what happened. I wonder if the piece of plastic could get sucked into the pump intake screen (if there is one) and cause cavitation/foaming?
Below is the back of a new site glass for my tractor and the plastic i found behind the hydraulic filter.
Kudos to the tech at the dealership for recognizing it and suggesting that that might be why I'm seeing more foam. I think he's right. The white would "hide" foam and since my site glass is missing the white i suddenly started to notice more.