There is a time element involved in Mary's alibi. She wants to stall for as long as possible before reporting her husband's death to the police, but she wants the leg of lamb to be thawed out by the time they arrive. Normally, when a housewife cooks a piece of frozen meat she will let it thaw out by itself, but she can't afford to take that much time. A leg of lamb would take hours to thaw out naturally.
The author knew it would occur to many readers that sticking a frozen leg of lamb directly into the hot oven was an unusual way to cook it. How could she tell how long to cook it if she had to allow for the time it would take to thaw out in a hot oven? Her asking the grocer about it is the author's way of reassuring the reader that this is not a serious plot problem. Their conversation goes as follows:
"I don't much like cooking it frozen, Sam, but I'm taking a chance on it this time. You think it'll be all right?" "Personally," the grocer said, "I don't believe it makes any difference."
The grocer is something of an authority on the subject. It is probably true that it doesn't make much difference as long as one allows extra time for the thawing out in the oven.
Roald Dahl is a little vague about the length of time it takes for the leg of lamb to be fully cooked. We know that Mary's husband came home right around five o'clock. The murder must have occurred around a half-hour later, and Mary put the lamb in the oven right after using it as the weapon. She stalls for about a half-hour before calling the police to report finding her husband's body--and all that time the lamb is thawing in the hot oven. They search thoroughly, both inside and outside the house.
It began to get late, nearly nine she noticed by the clock on the mantel.
So the author has given the leg of lamb over three and a half hours to thaw out and cook. When Mary invites the policemen to eat it, she says:
Why don't you eat up that lamb that's in the oven? It'll be cooked just right by now.
According to the Introduction to the story in the eNotes Study Guide (see reference link below), "Lamb to the Slaughter" was published in the early 1950s. People had less experience with frozen foods than they have today. Home freezers themselves were a new post-war innovation. Both Mary Maloney and the reader of Dahl's story would have been a little unsure about how to cook a big piece of frozen meat. But Dahl had to deal with this plot problem head-on. It was absolutely essential to his perfect-crime story that the leg of lamb would not be in a frozen state when the police arrived. Mary had to stick it in the hot oven and then stall for a little time by going to the grocery store and pretending to discover her dead husband about a half-hour after she had actually killed him. This would give the lamb at least a half-hour to thaw out in the oven, which certainly would have expedited the defrosting process.
I think she wanted to cook it as soon as possible to get rid of any type of evidence from Patrick's death.
But on the other hand, she was telling herself that she had to make Patrick dinner right away to calm herself down, so I'm just guessing she wanted to cook it as soon as possible either way.
Hope this answer helped in some sort of way!