I found the issue: the message did not show properly because I used add attribute, and I should use addFlashAttribute.
It does not work with:
redirectAttributes.addAttribute("msg", msg);
It works with:
redirectAttributes.addFlashAttribute("msg", msg);
Based on this explanation, my understanding is that it makes sense to use FlashAttribute after a modal window, because FlashAttribute uses a map stored in the session, which would be updated after I close my modal, vs. addAttribute, which would need to reload the original page.
If this understanding is not correct, I will be grateful if someone can explain why in my case FlashAttribute works and not Attribute.