Why is Stockfish giving me this weird move? When I ask for the best move for this FEN:


  1rbq1rk1/b4p2/p2p3p/3Bp3/P3P3/2P4P/R2Q1PP1/4K2R w -- - 0 30


[FEN "1rbq1rk1/b4p2/p2p3p/3Bp3/P3P3/2P4P/R2Q1PP1/4K2R w - - 0 30"]


Stockfish (via Python) replies


  e1e2


which is a losing move, since there's a free pawn on the 6th rank that the white queen can take. Instead, Stockfish wants me to move the white king for some bizarre reason.

Why does it do this? 

I suspect it may have something to do with the ending to the FEN, namely the part where it says


  -- - 0 30


I wrote the first part of the FEN by hand, and it is correct, but I didn't know what move it was or how to describe castling, so I just made up the "-- - 0 30" part. Is that the reason Stockfish gives this confusing answer?
You have a bug in your script. Try it on Stockfish yourself:

position fen 1rbq1rk1/b4p2/p2p3p/3Bp3/P3P3/2P4P/R2Q1PP1/4K2R w - - 0 1
go movetime 1000



  bestmove d2h6 ponder c8e6


How many nodes have you given Stockfish to think?