Police are investigating a mysterious fire at what is thought to be one of Scotland's most haunted buildings.