Can you see with scope the dir pin is being flipped ?
The level converter, its has to supply, worst case, 16 mA for each pulled up pin, eg, ENA,
OPTO, PULL, DIR, so confirm its able to meet their high level requirements.
Note when you post code use the code tag menu item, it makes the code...