Moonlight_tsarina, I wonder if you may be confusing the line of succession to the throne with the order of precedence? There are not the same.
In Britain, the succession line goes from monarch to the eldest son (then down the line through all of his direct heirs if there are any). If not, it goes to the monarch's second son (and down his line to his heirs), and so forth through all the sons. A monarch's daughter (and her heirs) only comes after the absence or extinction of any brothers and their heirs. The Princess Royal was therefore never immediately after William and Harry - her two younger brothers have been ahead of her since their respective births.
At birth, Anne was 3rd in line (after her mother and brother Charles). Following the Queen's succession, she rose to 2nd (behind Charles). Following Andrew's birth, she fell to 3rd behind him. Following Edward's birth, she fell to 4th behind him. The births of William and Harry moved her down to 5th, then 6th. The births of Beatrice and Eugenie moved her down again to 7th, then 8th . And finally, the births of Louise and James Wessex moved her down to her present 10th.
As far as order of precedence, there are technically several of them. There are separate "official" lists for women and for men, another that is a little more complex because it depends on whether an individual's spouse is present or not, and finally a "private" list for use at royal gatherings that are not state occasions.
For the female list, the official order is (1) Queen, (2) any living Queen Dowager, (3) the wife of the Prince of Wales, (4) the wives of the Monarch's younger sons, and (5) the Monarch's daughters.
But in 2005, Queen Elizabeth II altered the private list, putting the Duchess of Cornwall fourth after herself, the Princess Royal, and Princess Alexandra, contrary to the usual position of the heir's consort. This differed from earlier, because the late Princess of Wales had ranked above the Princess Royal and Princess Alexandra.
The Duchess of Cornwall continues to rank second in the order of precedence at official occasions, such as state dinners, or whenever Charles is present with his wife (in which case she draws her precedence from his rank, not her own).
Hope that helps.