When you use a noun - slave, prisoner, billionaire -- to refer to a person, you are assigning them an identity, you are saying this is what they are. There are some people these days who feel that this erases the fact that someone actually did this to them. It lets the enslaver disappear almost as though they merely harvested a resource. By saying "enslaved people" you re-emphasize that these were in fact people and that someone chose to enslave them. Not to turn them into slaves, to somehow change their identity, but to do something to them that took away the freedoms and rights they should have been entitled to.
That's why the phrasing is gaining popularity. Are you wrong to continue to use the word slaves? No. It's not like "the n word" or "the r word" or other words we no longer say. Should you take a moment and think about the enslavers in the story you are telling and what they did? Probably, yes.
Another note: dehumanizing and derogatory are different. Both "short" and "stupid" can be derogatory, but when you call someone those adjectives, we all agree they are still people. Some words leave a faint nuance that the target you identify with them is somehow not quite a person, that they have a different, lesser identity. Like companies that call their people "resources" or "headcount" as fungible and interchangeable things whose humanity doesn't matter to the company, or generals who call dead soldiers "losses". I am not sure something as lampshaded as "include the word person or people so everyone remembers they were people" is the only way to solve this, but that's what Grammarly is saying to you.
You won't be wrong to use the word slaves, especially for younger readers (less syllables.) But it doesn't hurt to think about who and what they were before someone enslaved them, and consider adjusting your words a little.