Electromagnet with iron core seems to attract strong neodymium magnet when I want to repel
There are two kind of forces: the electromagnet VS. magnet, and the reluctance force of the  electromagnet and the magnet. The reluctance force is the one which actually binds the two pieces together. This is what the electromagnet is designed for.

 

As the NdFeB magnet has a higher magentic flux density than your electroagnet, it simply binds on the armature, the repulsion force is smaller that reluctance force.