I've been reading through Section 67 of the Housing (Scotland) Act 1987 [as amended by The Housing (Scotland) Act 1987 (Tolerable Standard) (Extension of Criteria) Amendment Order 2021], together with this information on the Scottish Government website
https://www.gov.scot/publications/fire-and-smoke-alarms-in-scottish-homes/
and the summary of its implications here
https://www.stronachs.com/news-insights/insights/62-residential-property/562-smoke-alarms-in-scotland-new-legislation-for-2022
As I read it (and I'm confident that I'm right here), the only 'penalty' a vendor faces when placing a non-compliant home on the market is the inclusion of a reference to such non-compliance in the Home Report.
As an analogy, the situation is akin to selling a home that's badly in need or rewiring. The vendor isn't obliged to have the property rewired before offering it for sale.