First of all, I'm an American landlubber so I'll be confining myself to information gained from OW.
When I had ships with original logs, not the monthly fair copies, the intro pages of one or more of the books laid out the dates of the voyage. (This was so long ago, I don't want to wade through all my pages to find examples.) Going by the handwriting and signatures, The dates had been predetermined at the start of the voyage, and then that very first page of the voyage was signed for by the commanding officer at the end of the voyage. The number of months in the voyage varied, but they always began and ended on the same date.
Example, sloop Torch had a 13 month voyage that began and ended on the 23rd of the month in Sydney. They finished in a New Zealand port at the very start of WWI in 1914, and their crews transferred to other, more modern warships. When it happened again in Malta to destroyer Torch, that voyage had been about 18 months. All of her crew were paid off and sent to HMS Egmont (Malta's base ship), captain and officers included. I'm assuming they either were distributed among the other ships of the Mediterranean fleet or given free passage home to England. Somebody
kept taking weather readings for the next day or two, I assume yard hands. Then a whole new crew and officers and captain came aboard, and off they went all over the Mediterranean and Black Seas.
Clearly in both cases, end of voyage did not mean going back home to England, but still had been very neatly planned. It's not as if the RN can't find lots of transportation.