6N137 Isolating Ground
In the case of the second circuit have you made sure that the GND2 connects to the return of the 5V output supply?

I ask this because if this connection is open it could explain why the coupler is unable to pull the output low. This particular case would be where the GND connection of your scope or meter is properly connected to the GND of the 5V power supply.