I'm only part way through looking at this, but am running out of time -
There's a marriage on ancestry for Rachel Dawson, widow, to James Walmsley on 1 Nov 1828 at All Saints Otley which is five miles from Fewston. James's marital status is not given but his occupation is - he is a hatter.
Looking at Otley baps I found:
William Edward son of James and Ellen bap Nov 1822
John son of James and Ellen bap Dec 1824
James Maude son of James and Rachel bap Dec 1829
There's a marriage of James Walmsley of Otley to Ellen Watkinson in 1821 at Guiseley. It's possible/probable this is the same groom
Anyway, moving on to the 1841 census
Kirkgate, Otley
James Walmsley Hatter 35 yes
William 15 Yes
James 9 Yes
So, William listed as 15 when he's 19 is fine as he should be rounded down. James' age is a bit out, but close enough given father's occ fits. I presume Rachel has died but I've not looked for her at all, nor looked other than for two seconds at the 1851 where I found nothing but I think I only looked for the correct spelling (can't remember!)
Must dash..........