The King warned that the climate is “changing dangerously” as he took part in a ceremony to mark the Scottish Parliament’s “milestone” 25th anniversary.