The Musashi performed better because it had a full crew, sufficient fuel for maneuvering and plenty of alternative targets.
The Yamato was on a one-way suicide mission with an abbreviated crew, enough fuel to get to Okinawa but not return, and only a light cruiser and a handful of destroyers as alternative targets.
Its not my opinion. I’ve forgotten now the source, perhaps it was Garzke and Dulin’s definitive work, but the writer posited (with a detailed explanation) that the Mitsubishi yard was superior to the Kure naval yard, in the skill of its workforce and construction techniques.