One of my favorite books from Agatha Christie for example is called "And Then There Were None" . The original name of the book was "Ten Little Niggers". They changed the title and explained why on the first pages, while the story is completely intact. It wouldn't work without that rhyme. (I've read it in German and here they only changed the title.)
But I'm now reading that for the United States they changed also all references to the word "Nigger" into "Indians" or "Soldiers". It's a really complicated and delicate matter and it varies across nations, depending on their culture.
I just went looking into this example more after you mentioned it, because that is also one of my favorite books despite its gross history. Given that "Ten Little Indians" is a song I'd heard of separate from the book, and Christie obviously liked to theme books around actual rhymes/songs, I was suddenly left wondering how much of the updated versions' songs were actually just matching real life changes to the songs too. (I forget if the American version I first read - which was a little older than the copy I now own, too - was "Indians" or "soldier boys", but apparently we never had the original title.)
tl;dr: at a quick glance at Wikipedia, it's complicated, cause there were actually similarly very racist "Indian" versions of the song at the exact same time in the 1800s, but it does seem that in modern times "soldier boys" is indeed now also used for the song separate from the book
So I'm not sure if the current "soldier boy" lyrics in the book match any current version of the actual song (certainly the version of "Indian" I heard outside of it was just counting vs listing deaths), but I guess that choice does reflect how the song itself has been edited/updated too, interestingly enough?