I have searched the Strathaven records a great deal in the past, and not found any gaps as you suggest, (that's not to say there may be some of course).
Familysearch.org have the film, but it is only viewable at an LDS library, or affiliate library, and not from home.
There is a search facility on the film, and about 18 baptisms for Hamilton children between 1840 and 1855 come up, so those years would seem to be on the film. Not with your father James.
There is a baptism on familysearch.org for a James Hamilton 29 July 1812 at Strathaven. Father Thomas. No mother's name given in the transcript. No image.
From 'Scotland births and Baptisms film 1564 - 1950'.
This record again doesn't seem to appear on Scotlandspeople.
Several trees on familysearch, (they may be copied from each other of course), give your Thomas, the father of James, born 'about 1813' - some years earlier than you have written as 1822.
Although if James and Margaret Hendrie were married in 1838 as you say, (no record found), then he would only have been 16 years old if he was born in 1822. Not impossible, but somewhat unlikely.
6 other children between 1808 and 1822 at Strathaven with father Thomas Hamilton, no mother's name given on any of them from familysearch.
It's odd that there are specific dates both for Agnes Hamilton's birth, 15th May 1843, and James and Margaret Hendrie's marriage, 18th May 1837, (or April 1838, which makes this more unsure).
Have you actually searched through the Strathaven register?
You would need to visit an LDS library, or affiliate library - I know my city library is classed as an affiliate library, so you may be able to find one near you if there is no LDS library nearby.