OPT Confusion - If case process is delayed, what to do in between

Hi all, I have a doubt regarding OPT. Let’s say I apply for OPT in the first week of march for a start date of July 10. And for some reason my application processing time takes too long and I don’t get the EAD card by the time I graduate in May. Will I still be a lawful resident in the USA since the end date on the I20 changes when we request an OPT I20.

In short will I be a lawful resident in the time between graduation and receiving my EAD card What should I do in this period between graduation and getting the card.