Scotland passes controversial gender reform bill