One issue is the general way how the search will be performed. It will started in breath-first-way from both sides at the same time. In addition, it uses some flagging for already visited nodes. In this case you try to expand the same nodes from both sides.