Not a kids book I don’t think-
A fantasy/SF paperback maybe from the 80s? About a woman who gets dumped off on a semi primitive planet by her hosts. I’m remembering something like it was a traveling party ship? And she gets dumped in some small seaside town? She makes her way to the big city and attempts to earn money to support herself/get off planet by telling fortunes in the town market but is brought up short and taken up by the powerful magician of the town who sees that she has no magic and is faking the fortune telling. Very bad in a place where magic is real.
He is a sarcastic and very self satisfied type.
His brother challenges him for primacy in the family -a magicians duel – that is short circuited by her non magical interference. The brother loses. The jerk/ magician acts like himself some more.
So….
Our heroine (in some sort of snit with the magician) somehow gets on a ship leaving the planet only to find herself stuck with the magician who leaves on the same ship ( in a very self satisfied and sarcastic way, of course) to talk her back.