My son asked me how to castle on chess.com the other day, and I found that I couldn’t do it the way I normally do. Picking up the king and trying to move it to c1 just caused it to move to d1 instead, every time. I tried walking backwards and redoing a few different moves before this, and that all worked, but it just refused to let me castle by moving the king. Neither the king nor the rook had moved yet, and there was no potential or existing check involved, so what gives? Is there some other rule I’m just not aware of?

Sorry I didn’t get a shot of the board as well, I thought I had but I can’t find it on my phone now.