I have seen my manager do the exact same thing as you did. He went to the architect behind the codebase and started complaining and raising hell. Since my manager is on better terms with the higher ups things are swaying towards his end else it'd be a fiasco.
My suggestion is that when you encounter such code bases either go with it or do some small refactors in the smallest of code and say "hey I feel this is a better way to do it. Can you review this?". I have felt this has usually worked for me. Additionally, instead of stating it outright that the code is bad, ask them to explain the code and the reasons behind it. If you are still on good terms and they don't see you as a threat, then you can ask questions and maybe suggest alternatives with a working prototype. This way you still come off as an "honest" person who's trying to do something good. This works in your favor when looked at by your manager and upper management. This is apart from the features that you're tasked to push.
Hope that helps.