In character creation, the 'Strengths and weaknesses' you chose determine the chance of getting those stats on levelup. To answer your last question first; yes, levelling is random. Every character has a hidden list of 'growths', and these are the chance of getting any stat when levelling. If a character has a 60% Strength growth, it means they have a 60% chance of gaining 1 Strength when levelling. Yes, this does mean you can level up and gain no stats at all. You can also gain +1 to everything if you're lucky.
So stat gains
are random, but they lean in different directions with different characters. A Fighter will typically have a very high Strength growth value, where a Cleric will usually have a low Defence growth, etc.
The traits you chose at the start affect these growths. If you chose 'Swift', for instance, your Speed growth will have gone up, so you're more likely to get Speed when levelling. If you put your weakness as Fragile, your chance of gaining Defence when levelling will have decreased. These are not super important choices, but they do help with making sure your main character is as useful as possible. You'll still be able to play normally without min/maxing this sort of thing. As long as you didn't pick Magic as your weakness and then try to play a Mage, anyway.
All main characters start off as the same class (With the sword, like you said). However, the Talent you picked (You said you took Mage) can be accessed by using a Heart Seal. These are sometimes found on missions, but also pop up in stores.
I agree with you about the allies stealing your exp; it is quite annoying. But I've found it best not to think too much about it. There are plenty of enemies to get experience from.
Nice to see a new person joining the series, though! I hope you enjoy this one!