Ah yes, you seem to be missing one half of the balance sheet here, common mistake though it happens all the time
Debt to GDP by definition compares two sides of the balance sheet GDP and Debt