There's an Anderson family at Craig Mill Village, Logie, Perthshire in 1841 consisting of William, 25; Janet, 20; William, 4; James, 2; John, 6 months.
They're still there in 1851: William, 15; Janet, 33; William, 17; James, 14; John, 12; Mary, 10; Janet, 5; Robert, 3; David, 4 months, all born Logie.
These look like the family of William A and Janet Matson: James b 1838; John 1840; Mary 1843; Janet 1845; Robert 1848; David 1850; Janet 1853, all in Logie.
William Stewart Anderson was baptised in Kilmadock, not in Logie. He is in the 1851 census in Kilmadock, aged 5, with his mother Janet (37), born Dunblane, and sister Janet (9). Ann is not listed with them.
There is a listing in 1841 in Kilmadock of William, 28; unnamed female, 26; and Ann, 1.
So I think the William Anderson married to Janet Stewart is not the one born in 1814 in Logie. Fortunately it should be easy to prove. There is indeed a death in Logie (PER), of William Anderson, aged 69, in 1884, mother's surname Taylor. You could view this certificate for purposes of elimination, as it will give the full names of his wife (if any) and parents, but it does seem to confirm that he's not your man.
Looks as if this Malcolm Gray has made the basic error of assuming that the only candidate in the surviving records has to be the right one.