Ms Khawaja's tweets were re-tweeted several times by her followers before she realised the mistake and deleted it, tweeting: "False alarm: Have deleted previous tweets!"
She also said it was the result of a "silly prank" after her phone was left unattended, adding: "Apologies for upsetting anyone!"
By then, however, rumours of the Queen's death were spreading so quickly that Buckingham Palace felt it had no choice but to issue a statement denying the Queen was ill, breaking its own normal protocol of refusing to comment on speculation about the health of the Royal family.
Queen was in hospital
The BBC was carrying out a royal death rehearsal this morning, and its head of newsgathering, Jonathan Munro, had told staff to keep the fact of the rehearsal off social media.
The BBC later apologised for the tweet, saying in a statement: "During a technical rehearsal for an obituary, tweets were mistakenly sent from the account of a BBC journalist saying that a member of the Royal Family had been taken ill. The tweets were swiftly deleted and we apologise for any offence."
Sources said the tweets were sent as a "direct result" of the rehearsal being overheard and mistaken for the real thing. The BBC said an investigation as part of the corporation's disciplinary process would now take place.
Ms Khawaja describes herself as a multimedia producer at BBC News, producing news bulletins for BBC Urdu's current affairs television programme Sairbeen. She also reports for its website and radio shows.
A Buckingham Palace spokesman said: "I can confirm that the Queen this morning attended her annual medical check-up at the King Edward VII's Hospital in London.
"This was a routine, pre-scheduled appointment, the Queen has now left hospital."
The episode will have caused irritation at Buckingham Palace, and is another black mark for the BBC, following rows including a trailer edited to give the false impression that the monarch had stormed out of a portrait sitting in 2007, the BBC's inane coverage of the Diamond Jubilee River Pageant and a documentary earlier this year which was postponed after an intervention from Clarence House.
The BBC carries out dress rehearsals for the event of the death of the Queen or other senior members of the Royal family at least once a year.
Shortly before the erroneous tweets were sent out, Mr Munro had emailed staff to say: "This morning we are carrying out a low key rehearsal for the way in which television might cover a Category One obituary. It's mainly a technical procedure looking at the use of the studio.
"It does not involve any sites outside NBH [New Broadcasting House], and it will not include radio or online.
This has been in the diary for some time - there is NO editorial reason why this is happening now.
"Procedures have been put in place to isolate the rehearsal from any output. It will take place in Studio E whilst the Victoria Derbyshire show is on air from Studio B. We will be using internal camera positions on the mezzanine, and in the Business unit. The exercise should be completed before 1030, and the News Channel will return to E as scheduled at 1100.
"It's essential that we can rehearse these sensitive scenarios privately. BBC Tours have been suspended, and the blinds from public areas including reception and the media café will remain dropped.
"I'd also ask for your help in refraining from any external conversations and all social media activity about this exercise. Your continued discretion will be greatly appreciated."