Changing the URL slug causes redirecting to homepage, or showing 404 or missing lang_code issue

This is not a solution, but this works some of the times.

Try changing each and every relevant settings there is. Since we changed the permalink structure to 'custom permalink' the issue has been gone.

We were hesitant to change the permalink settings at first because that had caused all our global_colours to ‘invalid’. However, if we hadn’t had to change the settings, we might have been stuck in the problem still.

error code: 523