As Thrifty says alternator failure is very common. I had double alternator failure on every take off for 10 years until I finally found a maintenance outfit who knew what they were doing.
Meanwhile a reset once the u/c was fully retracted usually solved the problem.
I wouldn't attempt to guess what the specific cause of your problem was as there are a multitude of possibilities, but it is not good it happened in such a new aircraft.