Odds of it being the emu are extraordinarily slim. More than likely you're either accidentally using SEP instead of REP -- or you're REP'ing the wrong flag, or your REP isn't executing (like, the game is jumping past it or something)
I'm not familiar with any SNES debuggers, but they should allow you to step through code and/or set breakpoints. So step 1 here would be to set breakpoints on both your REP and on this LDX. Make sure the REP is being hit first -- and once it is, step through and make sure the X flag isn't changing at any point between the REP and the LDX