Hadronic medium effects on $Z_{cs} (3985)^-$ production in heavy-ion collisions