I don't understand how you were even able to plug that connector in to a fan header without applying unusual force. I am pretty sure the connectors are keyed just to ensure the correct connector is inserted, and that it is inserted in the correct orientation - just to avoid such situations.
In effect, you connected voltage to voltage instead of voltage to a load. Not good. If there had been high voltage present instead of the low voltage DC found on motherboards, there could have been serious consequences - like sparks, shorted and burned out components, burns to flesh, fire and serious injury - or worse!
Then I tried plugging it in while my pc was on
For future reference, there are no power connectors on the motherboard that are "hot swappable". None! That is, none are designed to support plugging in or unplugging cables or devices when voltage is present. None. Always, as in every single time, unplug the computer from the wall, connect your power cable, double check to make sure the connection is correct and tight, then apply power.
And for the record, while some data cables are "hot swappable", some are not. If not sure, better safe than sorry. Power down first.
you don't read the manual of your psu
And the manual for the motherboard certainly says that motherboard connector is to power a chassis/case
fan.
***
Every body here has certainly made stupid mistakes that could have been avoided if only we used a little common sense, had patience, and RTFM - read the friggin' manual. I think we might need to be reminded of that.
@adrian07 - You need to unplug the power supply from the wall. Then carefully inspect all your wiring again to make sure everything is correct and securely fastened. Then double check your wiring and plug the power supply back in and try to boot. If you still get the error, then I am afraid you might have damaged your motherboard. I would swap in another power supply to make sure. If it still does not boot with the second supply, then you likely need a new board. Just hope you didn't fry your CPU and RAM at the same time.