The case had alleged that Musk failed to timely disclose his buildup of ownership in the social-media platform he later renamed X.