Rise time of 6N136 opto-coupler
The optoisolator has the pin 7 floating. It is common to put a bias resistor from that pin to ground, to help discharge the base charges, which turns off the transistor faster. Not all datasheets mention this. Try for example a 10k resistor there.