What the.. It wasn't working last night. I tried pulling the engine out and it would always fail. now it worked first try.
PhoenixLodge mentioned before that this bug is often solved by closing the game and re-opening
Also, same solution if the redstone replaces the lever in the piston recipe.