Question: Thomas Maclellan of Bombie was responsible for the construction of a castle that was held by what what from 1782 to 1912?

Context paragraphs:
Thomas Jack (athlete): Thomas Jack (5 February 1881 – 9 October 1961) was a British track and field athlete.  Thomas Jack's introduction to athletics came through racing his brothers on the family farm near the small village of Bellsquarry, to the west of Edinburgh.  On the track, he won the Scottish 4 miles title twice (1908, 1912), the 10 miles seven times (1904, 1906-10, 1912), and in 1908 he finished third in the AAA 10 miles.  He was twice Scottish cross-country champion (1907, 1912) and ran in the International Championship five times (1907-10, 1912).  In the 1908 Olympic marathon his early pace was faster than his winning time in the Scottish AAA 4 miles and he dropped out after 5 miles.  A graduate of Edinburgh University, he was later Headmaster of Castle Hill School and served as President of the Scottish AAA in 1912.

Jackson House (Newton, Massachusetts): The Jackson House is a historic house at 125 Jackson Street in Newton, Massachusetts.  The 2 1/2 story timber frame house was built either c. 1768 or c. 1782, and is one of Newton's few surviving 18th century farmhouses.  A house is known to have been on the property c. 1768, but the present house use construction methods and styling more common to a later period in the 18th century, suggesting a c. 1782 construction date.  It was restyled in the 1850s to give it Greek Revival features.

Patrick Maclellan of Bombie: Patrick Maclellan of Bombie (d. c. 1452) Sheriff of Galloway, then the head of his family, the Clan MacLellan, and a staunch royalist declined an invitation to join William Douglas, 8th Earl of Douglas, along with the Earls of Ross and Crawford and Ormond in a powerful alliance against the young King James II of Scotland.

Thomas Maclellan, 2nd Lord Kirkcudbright: Thomas Maclellan, 2nd Lord Kirkcudbright was a Scottish nobleman, nephew of Robert Maclellan, 1st Lord Kirkcudbright and the son of William Maclellan and Rosina Agnew.

William Maclellan: Sir William MacLellan, created 1st Lord Kirkcudbright, was the son of Sir Patrick MacLellan of Bombie, and is best remembered for an undertaking inspired by a proclamation of King James II of Scotland that promised the barony of Kirkcudbright to whoever should disperse a troublesome thief known as Black Morrow 'dead or alive'.

Lord Kirkcudbright: The title Lord Kirkcudbright was bestowed on Sir Robert Maclellan of Bombie in 1633 by King Charles I of England on a visit to Scotland.  Maclellan had already been created a baronet in the Nova Scotia in 1631.

MacLellan's Castle: MacLellan's Castle in the town of Kirkcudbright, southwest Scotland, was built in the late 16th century.  It stands in the centre of Kirkcudbright, on the south side of the River Dee which flows into the Solway Firth.  The L-plan castle was the residence of the MacLellan family from whom it derived its name.  The family sold the castle in 1752, and from 1782 to 1912 it was held by the Earls of Selkirk.  Today, the site is curated by Historic Scotland.

List of works by Thomas Harrison: Thomas Harrison was an English architect who flourished in the last two decades of the 18th century and the first three decades of the 19th century.  Little is known of his early life, and his precise date of birth is not known.  He was born in Richmond, Yorkshire, and was baptised on 7 August 1744.  In 1769 he was sent to study architecture in Rome.  He started his professional life as an architect in 1782.  This followed his success in a competition to design Skerton Bridge in Lancaster, Lancashire, as a result of which he moved to Lancaster.  While there he carried out a number of projects, including a new tower and spire for St John's Church, a clock tower for the town hall, and new buildings within the complex of Lancaster Castle.  While he was working on Lancaster Castle, he was also involved in the design of new buildings within Chester Castle, Cheshire.  In 1795, Harrison moved with his family to Chester, where he spent the rest of his career.  Following his success with Skerton Bridge, Harrison designed more bridges, including Harrington Bridge in Derbyshire, St Mary's Bridge in Derby, Stramongate Bridge in Kendal, Cumbria, and smaller bridges in Lancashire, and Cheshire.

Berkhamsted Castle: Berkhamsted Castle is a Norman motte-and-bailey castle in Berkhamsted, Hertfordshire.  The castle was built to obtain control of a key route between London and the Midlands during the Norman conquest of England in the 11th century.  Robert of Mortain, William the Conqueror's half brother, was probably responsible for managing its construction, after which he became the castle's owner.  The castle was surrounded by protective earthworks and a deer park for hunting.  The castle became a new administrative centre of the former Anglo-Saxon settlement of Berkhamsted.  Subsequent kings granted the castle to their chancellors.  The castle was substantially expanded in the mid-12th century, probably by Thomas Becket.

Thomas Maclellan of Bombie: Sir Thomas Maclellan (died 1597) was Provost of Kirkcudbright and father of Robert Maclellan, 1st Lord Kirkcudbright.  He was responsible for the construction of MacLellan's Castle in the town.

Supporting paragraphs: Thomas Maclellan of Bombie MacLellan's Castle
Answer: Earls of Selkirk