Yeah, this is the trap. That form component probably had negative ROI. Unless it was blocking new features or causing bugs, you just spent velocity on feel-good work.
Real debt is stuff that slows you down: a Lambda that times out under load, DynamoDB queries that scan instead of query, deployment that takes 45 minutes. Things that compound. That analytics bug was your actual cost.
I've seen teams ship refactors that look like progress but just shuffle the deck. Better heuristic: only refactor if it unblocks something else or it's actively breaking. Otherwise leave it.