Edward VI was legitimate; all sides agreed that. When Henry married Jane Seymour Anne and Catherine were both dead. He had no wife living; the marriage was perfectly valid; Edward was legitimate. As a boy, he pre-empted any sisters, legitimate or otherwise. So even the diehard Catholics regarded Edward as Henry’s legitimate successor.
Things get complicated when Edward died childless. The older of Henry’s two daughters, Mary, was the daughter of Katherine of Aragon, and Henry had annulled that marriage and declared Mary illegitimate. Catholics, however, regarded her as legitimate. The younger daughter, Elizabeth, was the daughter of Anne Boleyn. Catholics regarded her as illegitimate, no question. Henry had in fact annulled his marriage to Anne just before her execution - he was never one do do things by halves - and so for a time Henry and his followers regarded her, too, as illegitimate.
Henry expected Edward to survive him (which happened) and no doubt expected that Edward would marry and produce children of his own (which didn’t). If Edward had married and had children, they would have come between Mary/Elizabeth and the throne, so Henry probably though, and certainly hoped, that their place in the line of succession would be an academic question.
However he recognised that he did have a responsibility to make provision for the eventuality that Edward would die without issue. He havered back and forth as to how to deal with this. Eventually he got Parliament to pass a law saying that he, Henry, could determine the succession by his own Will, and by his will he provided that the order of succession would be (1) Edward and his issue (if any); (2) Mary and her issue (if any); (3) Elizabeth and her issue (if any); (4) Henry’s niece Frances, the daughter of Henry’s younger sister Mary. (5) Frances’s daughter, Lady Jane Dudley. In laying down this succession, Henry passed over his older sister Margaret who had married into the Scottish royal family, and her issue, since he did not want the same person to be king of both England and Scotland.
As we know, Edward succeeded and then died without issue. He did not wish to be succeeded by a Catholic, so he made a “Device” omitting Mary frm the succesion (and Elizabeth, partly because her religious position was in doubt, and partly because it was easier to justify excluding Mary if Elizabeth were also excluded. On Edward’s death the next in line, Frances, renounced her rights, so Jane Dudley was proclaimed Queen.
The problem was that, while Parliament had granted Henry the right to prescribe the succession by his Will, it had granted no such right to Edward. The supporters of Mary, the person entitled under Henry’s Will, pointed this out. In the ensuing political struggle Mary’s supporters prevailed, Mary was proclaimed Queen and Jane and her supporters Got What Was Coming To Them.
Mary died childless and Elizabeth succeeded, as per Henry’s Will.
When, many years later, Elizabeth also died childless, the terms of Henry’s will would cause the throne to pass to the 23-year old Lady Anne Stanley, the senior heir of Henry’s younger sister Mary. Nobody seemed to think it was a good idea that the throne would pass to Lady Anne. Elizabeth’s prinicpal courtiers favoured James VI of Scotland, who would be heir if Henry had not skipped over his Scottish relatives in the Will made, by then, 56 years previously. They understood that Elizabeth preferred James also, though she never formally proclaimed the fact. On Elizabeth’s death, her courtiers proclaimed James VI king and Lady Anne, probably wisely, made no objection.