There's an opinion piece in the Herald about this. He publishes the full text of the Scotland Office's response to this and its hardly what the SNP claimed it was. His final few sentences sum it up for me. Sadly, I absolutely believe that they passed what they knew was bad law in order to pick a fight with the big bad UK over an emotive issue, knowing full well that most of the public only pay attention to the headlines.
"The UK Government suspects SNP ministers ignored their warnings about a lack of legal clarity and pushed ahead regardless to get a new stick to beat the Tories with at the election.
'See Westminster? They’re even against children’s rights, the monsters.'
If it was an electoral tactic, that would be cynicism of the basest kind. Promoting bad law, ostensibly to help children, in order to help the party."