I have already seen that military record that you found on Family Search. It has not been transcribed correctly. It is the same that you see on Ancestry. On the original document the number 17652 has been crossed through and the correct service number is 19182. (Just some clerical slip up at time of attestation). There is no mention of Carlisle. The addresses given are Joseph's at 99 Cannon st, and his brother at 21 Mereman st De Beers, Kimberley.
It does seem that Joseph resigned his post in China at the outbreak of the war and headed 'home' to sign up to fight. Why he then deserted 8 months later is curious.
My other thought is that he may not have been completely truthful about his age when he attested - perhaps wanted to appear either younger / or older than he actually was?
He attested for the 10th Battalion Yorkshire Regiment. The battalion was in Aylesbury training from Nov 1914 to May 1915, and then returned to Halton Park (Buckinghamshire) for a couple of months. Joseph deserted just before the battalion left for Witley camp (Surrey) in preparation for proceeding to France.
A little information here.
https://www.wartimememoriesproject.com/greatwar/allied/battalion.php?pid=6225