Moving the switch to OFF while the engine is running can damage the alternator and/or other electrical items in the boat. But I don't see how it could melt the cover.
Why would your boat not start? Dead battery, or some other issue?
Here is what happens when the battery switch goes to off:
If the battery was fully charged and the alternator just putting out what the boat was using then switching the battery out would not have any significant effect at all.
On the other hand, if the battery was discharged and the alternator was cranking out a significant amount of amps then when the battery is disconnected there is no place for those amps to go. The alternator can not shut down instantaneously so you have the paradox of the immovable object meeting the irresistible force: somethings got to give. What generally happens is that the voltage builds up very quickly until it manages to drive the amps someplace. That someplace can be through light bulbs, stereos, electronics, etc.
This can burn out light bulbs and destroy electronics. One electronic item that is often destroyed is the alternator itself, or at least the diodes in the alternator. They tend to self destruct and then don't work anymore, which can reduce or totally kill the output depending on how many diodes bit the dust.
This would not explain why the cover melted, as that takes heat and would require a fault to be present for a much longer period of time. One possible explanation is that the wire to the alternator was not tight and the poor connection heated up and baked over time. The alternator may still be fine, just a little disfigured but it is also possible that the heat killed something critical in the alternator.