A member of the royal family can also be removed from the line of succession to the throne by legislation, although under a convention enshrined in the preamble to the Statute of Westminster 1931 this would require the consent of every other Commonwealth Realm (independent states where the King is also head of state).
searches
https://commonslibrary.parliament.uk/research-briefings/cbp-10370/