A line you wrote stands out to me: Doesn’t happen on flat surfaces. Are the collision situations you are describing, involving non-perfectly-vertical walls? I can’t know what is causing your bug, but I can describe a character movement behavior that may be relevant.
I’ll describe the problem. Then I’ll describe some solutions.
The Character Movement Component behavior
When the character touches a wall, the Character Movement Component draws a projection of that wall to the gravity plane. So like, the “footprint” of the wall. Then, the Character Movement Component projects your controller stick input (loosely speaking), to the normal of that wall projection. It’s kind of like, if you make a shadow puppet on a wall, moving your hand closer or further from the wall, doesn’t make the shadow go through the wall.
The problem with walls that slope up a little, like a cliff face with a setback, is that the collision mesh is now different from the wall gravity projection plane. So, the Character Movement Component tells your character to be restricted by a vertical surface, but the wall mesh is moving further in and further out from that vertical surface.
This problem does not appear when the floor is flat. With a flat floor, your character is moving along the “contour” (math term) of the wall surface. This means the part of the cliff wall above you that sets back, or the theoretical part of the wall below your character which comes out at you, don’t actually touch you. Once you have a sloped floor, now you are changing which contour of the wall you are touching. You would calculate this change simply, by performing a cross product of the floor and the wall.
So, the reason classic games have a lot of vertical walls, is because the vertical wall constrains your XY movement, and the floor constrains your Z movement. The walls and floor are independent of each other. With non-vertical walls, now there is interaction between the floor and the walls, and both participate in your XY constraints.
Some solutions
Here are some approaches to this problem. First, look in Visual Studio 2022 for a function in your code that calls on the Character Movement Component. Right click on it, and select go to definition. Now, you have the Character Movement Component class open in a tab. Read that code to understand what the Character Movement Component is doing. Second, subclass the character movement component. Set up your character class, to use your subclassed character movement component. Override the SlideAlongSurface function, and make your own copy of the logic. Set it up so when your character touches a wall with NormalZ > 0, (upward sloped walls), you send the full normal of the wall to the Normal variable, not the gravity projected version. Now your character can wall up the walls. The next step is, in every tick, to move them down to the floor, and keep adjusting the move vector, until they find the floor. This is a cheap operation, and takes at most about 4 itterations with agressive walls. So, now your character will run along sloped walls happily. There are more nuances to prevent chatter, but you will see that once you understand what the Character Movement Component is doing.
Another solution, is to have vertical walls. Many games do this, and it is mathematically very elegant of a solution.
Also, I see in Xenoblade Chronicles on the Wii, that the character seems to be pushes away from walls in nature when you get too close to them. You have to deliberately steer the character to dig in to the wall, to create chatter.
Conclusion
I know this may not be the problem that you are facing. However, it could be helpful. Ultimately, the approach to solving this is to subclass the Character Movement Component, and methodically add on screen messages and UE_LOGs in relevant functions, to see what is firing and in what order, when you have your bug. I really hope this helps you.