Typically, disconnecting the collector from a transistor will be harmless, but that isn't always the case. Consider an NPN transitor with the emitter tied to ground through a 5ohm resistor and the base tied to a "rigid" 10-volt supply and the collector either attached to a "rigid" 15-volt supply or disconnected. With the collector connected, the emitter would be about 8-9 volts above ground (dropping 8-9 volts in the resistor), and the emitter current would be about 1.6-1.8 amps. Most of this would be supplied from the collector, and the transistor would be operating well within its collector-current (and total-power-dissipation) specifications.
With the collector disconnected, the emitter would still be about 8-9 volts above ground, and the emitter current would be about the same, but all the entire 1.6+ amps would be flowing into the base, which has an Absolute Maximum Rating of 1.0 amps.
It's doubtful that a typical microcontroller circuit would be capable of driving enough current into the transistor base to cause damage, but some other circuits would use transistors in such a way that a disconnecting the collector from a transistor could damage the base.