I have edited your question to refer to Act IV scene 2, which I assume is the scene you are referring to. It is important to remember that what the Mechanicals are doing was actually quite risky. To perform a play for the Duke's wedding was something of a poisoned chalice, in that it held potential for preferment and reward, but if anything went wrong and the Duke and his new bride were displeased, it could spell punishment or worse for the Mechanicals.
Thus this scene opens on the day of the wedding, and therefore just a little while before the performance of the play. However, and very worryingly, there is still no Bottom! Since Puck interrupted their rehearsal in the woods and enchanted Bottom's head into an Ass's head, the Mechanicals have not seen him. Of course, as he is due to play Pyramus, no one can be found to replace him at such short notice, as Pyramus is one of the major characters. Thus it is with great relief that the characters welcome Bottom back towards the end of the scene, bearing the news that their play has been chosen and they are to perform. The play will go on now he is back, with the hope of a reward.