You're right to suggest it would take some time.
Long and complicated negotiations with the Commonwealth would be only one of a series of negotiations.
It wold firstly require a referendum, which itself would require an Act of Parliament, and if a Republic was chosen, that would require another Act of Parliament. Both acts would need to be signed by the Queen, and turkeys don't vote for Christmas.
There would be bitter division throughout the Union, with factions based on race, religion, sex and age.
There would be widespread civil disobedience, and never forget, in the event of such troubles, the Queen is Commander in Chief.
Almost certainly the Union would break up.
Can't see it happening myself. Be interesting to see how it would pan out if Australia went down that road as many of them want to do do.