A Bill to provide greater protection of children’s rights has been passed by the Scottish Parliament for a second time.