What did I do wrong? 7-Segment display

I have used optos where what could happen on the far side (due to someone going off his meds) was 'variable' and a very expensive PC was on the near side, so to speak.
I would use one in a line between car power and an MCU for signal/power-status purposes.
I do note that they are very simple to use and the ones I had then came 4 to the chip.
I don't recall needing resistors on the input side but that was about 20 years ago. Maybe I did.

But many transistors can take more current and have a lower purchase price even with resistors.

I've got Darlington Arrays for middling power with built-in protection diodes in nice tight packages but no FETs yet.

Last time I was around FETs they were extremely vulnerable to any static at all. "The man with the money in the FETs, sweats." is how it was explained to me.