Hi Susan
Interesting - yes there might be a connection!
By 1820, I think my James Anderson was dead and his daughter Catherine (Mrs Cochrane) was nearly 40. I don't know about anyone else in the family (yet) so your James could be his grandson from a son. Where were they born? Catherine was born in 1783 in East Linton, Haddington, so if she had a brother, he might have been born there. I think James may have lived in Dunbar, not far from East Linton.
I found this reference on the NAS website to a court case, so this might refer to your James' father or grandfather:
NRS Ref CS231/A/3/15 Extract retour of the general service of James Anderson, potter in Alloa, as heir to James Anderson, residing in Dunbar, his father, dated 4 Feb 1804.
please do pm me
best
Kirsty