Hi Stephen
It can be confusing when you get conflicting information. However, in this case, you have a wealth of material which all points to Robert being James' father.
This is the family in 1861:
Robert White 38 gas maker
Janet White 28
John White 10
James White 8
Robert White 6
Alexander White 4
Hugh White 2 months
Address: Cotton Row , Irvine
So, you have the parish marriage entry for 1849. Every birth registration (statutory or parish record) for the children above, except for James, shows father as Robert. I think James has been written up in error by the parish clerk.
When he married, he gave his father's name as Robert. This is info that he gave, not a third party.
When he died, an informant to his death gave his father's name as James which looks to be an error. Likely he/she did not know or remember well his father's name. Who reported his death?
What were the names of his children with Ellen, especially the early born ones?
The info regarding his mother also tallies with her first husband being Robert.
Mistakes did happen and it is a pain when they do. However, you have so much supporting material which states father was Robert. Who reported Robert's death? Was this in 1867? Is this his death:
Robert White
Death Age: 42
Event Type: Death
Death Date: 25 Dec 1867
Death Place: Dalry, Ayr, Scotland
Occupation: Brusher
Colliery: Blair No.2
Owner: Eglington Iron Co
Notes: Fall of coal off the side of a pillar
(from the UK, Coal Mining Accidents and Deaths Index, 1878-1935)
Monica