Isabella died 15 Feb 1951 in Penicuik.
I don't know when William died
Assuming you have the death certificate for Isabella Allan Barrett does it say anything about her husband was he still alive ?
Do you have the death certificate? What was the address? Who was the informant? Have you tried the Electoral Register?
If he was alive could he have returned to London

There is this death entry but no date of birth - digital image available
BARRETT, WILLIAM JAMES age 61
GRO Reference: 1951 J Quarter in CITY OF WESTMINSTER Volume 05C Page 359
Baptism for William James Barrett
31 st March 1890 St Michael Highgate
Date of birth 19 February 1890
Can’t see a WJB with that dob on 1939 register
What was his occupation on 1916 m/c? 1921 looks as if he’s on his own in Islington, London
William James Barrett
1890 Highgate, London