He sent out the packages before he murdered Cassandra. The Disruptors received the boxes on May 13th (it says in the beginning of the movie) and Andi sent the email to everyone on May 11th (it says so on the email), two days before the gang got the invitations. It's stated that one day after the email was sent, Miles went to Andi's house on May 12th
He didn't intend to kill her but that changed two days prior to getting the box. Miles said himself that the puzzle guys who designed the boxes barely got it finished on time to deliver.
My point being, I highly doubt that he sent and got the packages delivered to everyone ONE DAY AFTER the murder.
The trial happened a few months before the events of the movie, so she would regularly go to Miles' annual parties it seems, and people thought she wouldn't this time since the trial costed her everything.
He originally wanted her to come (before getting the email and changing his mind) in order to gloat and remind her how her former friends chose him over her. He wanted to announce the launch of the energy source Klear and shove his success in her face and had no idea she had the envelope until later.
By the time he got the email, the packages were already shipped. But Miles thought it wouldn't matter considering everyone else would simply assume that she didn't accept the invitation, which makes sense after what happened.
Lionel actually said that the strange part wasn't inviting her, it's that she accepted the invitation at all. This indicates that Miles would invite her every year, but that she wouldn't have come this time due to Miles and her former friends betraying her.
It takes a while to deliver packages in the US. I mean the average shipping time for packages from Greece (where the Glass Onion is) to the USA is 15-17 days.
The day of the party is May 22nd (that's the date on the article on Andi's death, which Duke received on his phone shortly before his murder) and so the gang arrived over a week later to the party.
He doesn't look surprised when she comes because he doesn't want to look suspicious in front of everyone. He has to wait for an opportune moment, but he must attend to the party, while watching the other guests and making sure things seem okay. Plus there's also Duke who saw him go to Andi's house. Although Duke didn't know Andi was dead until later, he still could alert the group that he was there too.
Why would Duke think that Andi was killed before he saw the article? No one automatically assumes one murdered someone. Similar to Andi, no one thought Miles was capable of murder. For all Duke knows, Miles faced a similar situation, being that she didn't answer and Miles left after waiting a while for Andi to open the door.
Miles thinks that since Duke saw him leave, it would look suspicious considering he arrived WAY before everyone else, and Andi doesn't answer the door for anyone else that arrives. At least that's from MILES'S perspective, not Duke's, which I explained prior, along with the fact that he's worried about Andi more and distracted due to the damage she can do to his career.
When he does receive the news, of course he's happy. The one person that could ruin Miles (and by extension the rest of the group) is gone, and he thought he got what he wanted in exchange for his silence, since he still hates Miles (just like Andi, he could ruin his career and he hates holding on to Miles)