I see that, to date, 50 people have read my first post on this subject, so I assume there is some interest in it. As I have now found the answer to my own question I thought I might as well post a reply to myself!
With no malice intented, I have to announce that Mary Ansell seems to have lied about her age. She certainly lied to officialdom, and, who knows, she may have lied to JMB, not only when she met him, but also when she married him. She also lied about her place of birth.
Mary Ansell was definitely born in 1 March 1861, at the King's Head, 71 Moscow Road, Bayswater, London. Her parents were George Ansell and Mary Kitchen.
The family appear in the April 1861 census, with Mary's age recorded as 1 month. The same family appear in the April 1871 census, at a different address, and Mary's age is recorded as 10 years. (They always rounded down ages over 1 year). No lies or mistakes there.
But when she married James Barrie, on 9 July 1894, her age was recorded as 27 instead of 33. Presumably, she had given her date of birth as 1 March 1867 instead of 1861.
There can be no doubt that we are talking about the same Mary Ansell - the certificate of her marriage to James Barrie records that her father was George Ansell and her mother was Mary Ansell nee Kitchen.
Now, did JMB know his bride was lying about her age? If so, would he have been happy about it?
Mary seems to have maintained this deception for at least seven more years, if not for her whole life. In the April 1901 census she is recorded as Mary Barrie's wife, age 34 instead of 40.
But that's not all! In the 1901 census, Mary also lied about her place of birth, stating it as Northwood, Middlesex, instead of Bayswater or Paddington, London. Why did she do this? Was Northwood a more fashionable place to have been born, situated between Harrow and Rickmansworth? Possibly, but what did she think she would gain from this? The public - you and I - wouldn't be able to discover it until 100 years had passed. Or had she lied to JMB about her birthplace, and somehow managed to keep up the deception, presumably with the co-operation of her mother and three brothers (her father died before she married).
I would greatly appreciate hearing any thoughts on all this, please.