You may have many hurdles to sort back further than John SMITH, soldier, but from a quick armchair sweep of indexes I can see at least one ‘candidate’ may be:
Private John SMITH, 3rd Regiment of Foot, 4th & 5th Company, arrived per the Guildford, NSW 25 December 1822.
Was serving at Fort Dundas, Melville Island departing Sydney on the Countess of Hardcourt 24 August 1824, returning as part of a detachment to NSW some time between 1 November 1824 and 30 April 1825, sick. and was stationed on the sub-continent, at Calcutta from January 1827 to October 1827.
See the NSW Col Sec Papers Index re this soldier, and also under the heading ‘Melville Island’.
https://www.records.nsw.gov.au/archives/collections-and-research/guides-and-indexes/colonial-secretarys-papers A tad further armchair looking :
It seems that a chap named John SMITH originally served in The Buffs, after enlisting at Cork in Ireland for 14 years.
When the Buffs tour of duty in NSW was concluding, he transferred to the 39th Regiment, into Company 9 and he took his discharge with gratuity in Sydney 30 June 1832. May I suggest:
Paylists etc should be available via the AJCP see
https://www.nla.gov.au/using-library/research-tools-and-resources/australian-joint-copying-project Paylists can be useful in determining the marital status and number of children of the soldier based on the pay rate changes etc.
https://www.rootschat.com/forum/index.php?topic=829521.0 Also Biographical Database of Australia is a not for profit ongoing indexing project; there is a nominal annual subscription of $38, but you can look at the indexes without any subscription expenses.
https://www.bda-online.org.au/ I have not looked for Mrs Sarah SMITH (wife of John) or for Ann SMITH born circa 1829, Penrith NSW, but it seems likely to me that Ann would not have been the eldest child of Sarah and John SMITH. Perhaps they will be listed as a family in the 1828 NSW Census?
https://www.rootschat.com/forum/index.php?topic=810812.0 As yet, I cannot see any connection between this Ann who married Frederick RICE and the lass who entered the Benevolent Society’s facilities in 1863.
May share some off topic issues....
My husband and I are still 'stuck' in Sydney, locked down safely, etc but it is a tad difficult to access my hardcopy folders on SMITH in NSW research across the decades because those records are in our own home, up the coast, also in lockdown. When we do finally get back to our own home and business, I am sure that our priorities will not include immediately focusing on family history. Back in early June we had put together several 'dry groceries' packages and driven to ancient rellies in: far western, central western and central tablelands (of NSW) and had continued on to family in Oberon and then drove down the Mountains into Sydney, intending to have a quick stopover. Yes well that was the week that included June 23, I say no more.
I now know how to order groceries, bed linen, etc ONLINE, and to have these items and more delivered 'contactless', oh how I wish I had known how to organise that for all our ancient rellies across NSW back around mid May 2021...
JM