That the hymn writer's doctrine here is correct can be seen particularly clearly in the parable of the unforgiving servant (cf. Matthew 18:21-35) - the eponymous servant received (extraordinary) grace through the large cancellation of his debt but upon his insistence that another servant repay a much smaller debt owed to him, he was judged not worthy of the grace he had been shown and the initial debt was re-instated (with additional punishment!):
So also my heavenly Father will do to every one of you, if you do not forgive your brother from your heart. - v35 ESV
From this we understand that even though we can never earn saving grace through our own works, we can be disqualified from grace through exercising grace-less-ness to others - in other words, receiving God's grace comes with an obligation (debt) to give grace to others. This is the sense of Paul's 'debt'/'obligation' to preach the gospel (cf. Romans 1:14, 2 Corinthians 5:14 and this Q&A on the BH site).
A further sense that you are incorrect in your initial assessment (that the line from the hymn is heretical) can also be discerned from the following:
16 For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. 17 For God did not send his Son into the world to condemn the world, but in order that the world might be saved through him. 18 Whoever believes in him is not condemned, but whoever does not believe is condemned already, because he has not believed in the name of the only Son of God. - John 3:16-18 ESV (emphasis added)
Verses 16 & 17 speak of grace, while verse 18 strongly implies that there is an obligation to believe in order to receive that grace (as does: "the just shall live by faith" & "it is by grace you've been saved through faith"). Elsewhere, warnings against unbelief reveal an obligation to continue walking in faith lest we are disqualified from the grace previously received (cf. Hebrews 3).
In summary, the debt that the hymnist is referring to is real and is primarily an obligation to have faith in God, and to extend grace to others (particularly through preaching/living out the gospel as demonstrated in the life of Paul).