On a single day last week, the challenge facing Scotland as it grapples with managing the transition from oil and gas to renewable energy was on stark display.