Not 100% on this but on another recent thread it was mentioned if Charles were to predecease his mother the next in line doesn’t become Charles son William but the next born of the Queen’s children which would be Ann or Andrew and should they become monarch their children then become the next in line. For William to become King his father Charles has to be King before. For all the Prince William fans they better hope Charles becomes King for say a very short period.
No, that's incorrect.
The line of succession remains intact even if a person in the line dies. If the Prince of Wales predeceases his mother, the Duke of Cambridge (Prince William) will immediately become heir apparent. If the Prince of Wales and the Duke of Cambridge both died, Prince George of Cambridge would become heir apparent.
For the Duke of York (Prince Andrew) to become King, Charles, William, George, and Harry would all have to die or otherwise be removed from the line of succession. (The changes currently in process to give females equal standing in the line of succession only apply to children born from now on, so Anne, the Princess Royal and her descendants, remain behind her younger brothers and their descendants)
When Edward VIII abdicated a special law had to be passed expressly removing any children of his from the line of succession because otherwise any children he fathered would have, at least arguably, had precedence over the current Queen once her father died, such is the 'strength of a line' in the British law of succession. As it is, he didn't father any children, so it was irrelevant in the end, but it was a very real concern while his wife was of potentially child bearing age.
The scenario you describe has happened before - Queen Victoria remained in the line of succession after her father died and became Queen of the United Kingdom ahead of her father's three living younger brothers (the eldest of these did become King of Hanover, because Hanoverian law didn't allow a woman to rule, thus splitting the British and Hanoverian monarchies after a century of them being held by the same people).