There's one question I get all the time: should the Product Owner take part in your scrum team's sprint retrospective meeting?
In short, the ideal answer to this question is "yes." The Scrum Guide clearly states that there are three members of your scrum team:
If the sprint retrospective meeting is a whole-team activity, it stands to reason that the Product Owner should participate, especially if you're adhering to the agile framework laid out in the Scrum Guide. Having the entire team present will lead to a more honest discussion about the previous sprint, product quality, and the overall development process.
The pushback, of course, is that if team dynamics between the Product Owner and Development Team are strained, then having the Product Owner participate in the retrospective can prevent your team from discussing the problems it is facing openly.
An agile retrospective can only be truly successful when there is trust amongst the team...and realistically, there may be times when having the Product Owner present could hinder a productive discussion about potential improvements.
Remember though: not inviting the Product Owner to your sprint retrospectives is agile's version of a Code Smell. In other words, if you feel uncomfortable inviting the Product Owner to your agile team's retrospective meetings, there's probably a deeper issue at play -- and not including them will likely prevent the team from forming an actionable plan for improvement. Consider implementing a safety check at regular intervals to keep an eye on team dynamics, and to ensure that the retrospective is a safe space for everyone.
So, should the Product Owner attend your sprint retrospective? Yes, if at all possible. The PO is part of the scrum team, and including them in your retrospective meetings is necessary to ensure continuous improvement. But, from time to time, it may be helpful to have a closed retro between the Scrum Master and Development Team only.
...just don't get used to it.