I would rethink the approach a bit.
First of.
You already have a method of detecting what is being connected with - the capsule.
Any default character class has one. It’s actually useful in this case since you can use it to detect the walls collision.
Second, any piece of stuff in the game should cause an overlap or hit event with the capsule.
This means that if the part of the wall you are interacting with changes, you could also quickly change the normal you are interacting with to make calculations.
because this is done on a moving character, you can probably ignore the fact that collision on being overlap events aren’t always accurate. They will be accurate here because the capsule is moving against the wall, so it should generate hit and overlaps as it goes anyway (if not on the first time, on the next 3 or 4 which are calculated in a millisecond while you move).
that solves one part - sticking yourself to a wall. You can re-work all that code you have and simplify it using that information.
Now the corners.
So, for animations to be smooth you need to know about the corner beforehand.
2 solutions I can think to this, and it depends on your game and how you work.
solution 1, every corner gets the same tag that the character BP will check in order to know and prepare.
Solution 2, you run a sphere check on the direction you move in about 1m ahead, and once that sphere check is false you know to prepare for a turn.
you can actually combine Both methods, and allow the character to prepare to get out of the sideways walking animation into a regular animation if the wall ends and you have no corner tag (think of a doorway for instance).
Anyway, based on the information you have above, you can prepare a turn, and rotate your character or the root bone perhaps to match the angle of the new wall where the other system can take over again.
Theoretically, if you misslabel a wall to be a corner, you should get your character into whatever animation set you have to prepare for the turn, and then abort and go back to wall walking because the overlap on the capsule detected the wall again.
Anywah, that’s my theory and how I would go about implementing it. (Which I need to, eventually).