The short response
A warning does not turn the people who remain into combatants. An attack must still comply with the rules protecting civilians.
The evidence
People may be unable to leave because of disability, illness, lack of transport or the absence of a safe route. The ICRC explains that merely staying in a besieged area does not amount to taking part in hostilities. Warnings are one precaution, not a substitute for all the others.
Why the argument does not follow
This mistakes an instruction to leave for the removal of civilian protection.