Just acting? Which (agile) role do you play?

Some time ago, I told a friend of mine, who is not familiar with Scrum, about my work and the different roles in Scrum. He smiled and said: “That sounds a bit like the cast of a play. Everyone plays a different role.”
And actually, it is a bit like theater or in a movie. Roles empower people in organizations to take over responsibility for specific tasks. Thus, work can be organized with the help of defined roles. Roles are not permanently assigned to particular people; they can take on different roles if they have the appropriate skills and abilities.
Just like an actor: One time, he slips into the bad guy’s role, and at the next engagement, he is the chief inspector.
The Scrum accountabilities
A Scrum Team consists of the Product Owner, the Developers, and the Scrum Master.
The Product Owner is the one with the vision. He is responsible for maximizing the value of the product. He manages the Product Backlog.
The developers are the people that create a usable increment each Sprint.
The Scrum Master promotes Scrum according to the Scrum Guide. He supports all participants in understanding the Scrum theory, practices, rules, and values.
Change of role
But can you actually slip from one role into another so easily? From Scrum Master to developer or from developer to product owner? It is not quite that simple because the prerequisite is that you have the necessary skills and abilities. Competences are based on knowledge and experience, abilities, on personality traits. A Scrum Master who wants to take over the role of a developer in a Java development team will have a hard time developing in Java. But if the necessary competencies and skills are available, it should be possible.
However, I also observe parallels to the movie here: If someone has played the chief inspector of a series for years, it will be challenging to get another role.
It is the same with Scrum: if you have been in the role of a Scrum Master for years, you are only seen in this role, even if you have the skills and abilities to take on the Product Owner role.