There's a song lyric that, when repeated, becomes a different sentence even though it's pronounced the same:
You're worn out sole to heel
To heal your worn-out soul
You're worn out sole to heel / you're worn out sole / to heal your worn-out soul
Is there a specific name for this kind of sentence where it completely changes meaning because of the heterographic homonyms?