Neutron star collision should have formed a black hole — but a ‘magnetar’ appeared instead