There is a lot of misinformation on the web around Vitamin D, such as that even high amounts (>= 5000IU) are tolerable and safe. After a blood test showed me Vitamin D deficient, taking 5000IU (that size is readily available over the counter at my grocery store) daily gave me disturbing heart palpitations, which I didn't realize were related to Vitamin D until after thousands of dollars in tests showed my heart to be perfectly healthy. It wasn't until I had slacked off in taking the vitamins and then started taking them again that I discovered the connection. Apparently magnesium has something to do with it, but IANAD. (I was not taking magnesium supplements at the time.) I can tolerate 1000IU occasionally, but people need to be aware that not everyone tolerates supplements (especially high doses) the same.
I was happy to see the article you linked to above only claims Vitamin D is considered safe up to 4000IU. Although IMHO, after my experience, anything over 1000IU should require a prescription. Of course nothing would stop people from taking five 1000IU OTC doses to get 5000IU, but I think most people know better than to take five of the same type of vitamin daily without talking to their doctor first.
I do not doubt your experience, but it seems incredible to me that just a 5000 IU supplement gave you heart palpitations. Then again, I've also read many reports about incorrectly labeled products (e.g. milk, supplements, etc.) which contained far more D2 or D3 than what was written on the tin, causing toxicity.
It is completely possible for "more of a good thing" to have a negative impact on you because it pushes something out of balance beyond what homeostatis can maintain. In principle the best solution is to go get more of what you need to balance it, but that can be easier said than done. Between the things that science still just plain doesn't know and the chaff of all kinds of garbage information about nutrition on the internet it can be very hard to figure out what you need.
I take roughly 5k per day in the winter and it has helped a lot. See my other post for details.
Did the supplement you took include those, or at least Mg?