I had one pit with 2 zombie villagers and a lectern in it. There were no other lecterns in the village. I also had another pit with a libarian where I traded already with in. In that pit, there was no lectern. when I let the villager escape from the pit, it runs to the lectern in the pit with the zombie villagers.
Can confirm that this is an issue. Also affects 20w51a. It seems that obtaining a job is more important than avoiding a zombie. You will notice when reproducing this bug that the villager does not react upon being hit by the zombie. Its focus remains on the work station that it's pathfinding towards.