Stability tests undertaken before the maiden voyage had identified the problem, but no one wanted to inform the King of the issue.
Contributing factors as reported in the press:
Lack of technical knowledge needed to make the project a success (due to lack of prior experience with doubled-deck gun ships at that time). Pressure from senior management (the King) to get the project completed. Breakdown in communications (unwillingness of those responsible to tell those in power of the flawed design or results of the testing). Some indications that requirements were changed in the middle of the project and the changes in the design contributed to the stability issues.
The ship was raised after 333 years and is now in a museum.