Ghostbusters needed ->Project went crazy

Some context:
I’ve been working latelly on a big code refactor for my proyect. Basically i just changed some data structures to use a wrapper, but kept using same algorithms to manipulate this data. While doing this, i felt VS pretty unresponsive and slow on intelisense and so, so i decided to try rider for UE.

First problem:
Once everything was green and compiling, starting to try the game functionallity and got some crashes (as expected). But weird thing begun to happen on debugger. first with this function:

Bug1.PNG
As you may see, auxT is pretty useles as is a copy of maxX. It is only used for the loop. Before the refactor, auxT didnt exist but, while trying it out after the refactor, maxX values went missing after the sorting call. For me makes no sense… decided to make a copy and try to use that auxT for the loop. This way, maxX value keeps going missing (gets a big random number negativer or possitive, seems like a memory possition), but auxT keeps the right value. Cant understand why. But that isnt even the weirdest thing, the thing is that not VS nor rider can debug the auxT variable. I cant set breakpoints on auxT=maxX line nor inspect auxT value at any point, it says variable is undefined.

Second problem:
After this mistery… i decided to ignore it and go on for now… since it is working somehow ingame. and found another similar ****:
Bug2.PNG
While debugging this function, i find the debugger stops in 2º line, then first line then second line again. And sometimes it returns an empty array. GetReach is always called, and never returns the empty array. While stopped on the breakline at the 2ºnd line i can never see the value of valids as inspector says it is undefined, just like happens with auxT.

What i tried:
As i thought it could be related to the use of rider… i tried everything with both, rider and VS, getting exactly the same results.
Tried to refenerate VS files from uproject.
Tried to clean and recompile again and again or compile from inside the UE.

I’m not usually very keen to ask for help but cant imagine any solution other than go for a backup and lose all the work. Did you see similar problems before?
Any help would be appreciated