Vaughn Palmer: Last-minute change to Mental Health Act shows every sign of a government making things up as it goes along