I have found the issue. When you invoke console.log(req.flash('success_msg')); it clears/destroys the flash message. So if you would read it again, so another console.log(req.flash('success_msg')); then it will be empty.
And since I'm reading it
console.log('flash sucess before setting locals:', req.flash('success_msg')); // Logs flash messages before setting locals
console.log('flash error before setting locals:', req.flash('error_msg')); // Logs flash messages before setting locals
res.locals.success_msg = req.flash('error_msg')[0] || '';
res.locals.error_msg = req.flash('error_msg')[0]|| '';
it is already empty where I want to store it in the res.locals