I need to remove the OOTB roles (Observer, Editor and Owner) and replace them with the custom roles.
I created the new roles under /apps/<my-app>/projects/<project-name>/roles.
The new roles start appearing in the list, but the default ones are not replaced.
Has anyone had a similar requirement. Any help would be appreciated.
Disclaimer: I'm not a Projects expert.
Are you overlaying a project under /libs? If so can you use create the same-named resources as the observer/editor/owner entry item resources, and use "sling:hideResource=true"  to hide them in your overlay?
The OOTB roles come from a data source /libs/cq/gui/components/projects/admin/datasource/projectroledatasource which at the backend is a servlet registered on this resource type (it is not a node). This other than returning the options for the roles dropdown, performs additional functionalities like create groups of the name <myproject>-projectrole under the /home/groups so that permissions can be assigned based on the role.
So, for these OOTB roles there is no node to overlay from libs.