Freezing will kill bugs, not necessarily all of the eggs. It depends. But washing the rice or beans takes care of that problem.
I don't know if the beans can be kept for seeds. If it was old enough for the bugs to hatch the beans were probably old to start with and if they were drilled by the bugs the germs may be damaged. But you can try. Bean seeds are good for about 10 years if properly stored.
You can plant corn in large pots but you still have to consider spacing. If your pots are small, corn will not grow very big. There are dwarf varieties of corn, but they still need a sizeable pot. If you plant corn too close then the pollen will not have room to reach the silks. You might have to bag the tassels and hand polinate if that is the case. In summer, only a couple of things will grow in the heat providing you have enough water corn, squash, beans, and cucumbers. None of the greens will do well unless they are grown in the shade and watered several times a day just to keep them cooled off.
In summer, I plant corn in my small garden. It takes up half the space. I let the butternut squash sprawl under them. I plant sunflowers on the periphery. I don't care for beans and I grow Asian long beans which can handle more heat than string beans and has fewer pests. You can plant bush beans which would not need a trellis. Pole beans will need a trellis or you can plant them after the corn has tasseled so you can use the corn stalks as a trellis. I would plant most of the garden with corn in summer. It is something I usually don't waste anything of and I grow it at a time when other things don't really like to grow anyway. Smaller things I can grow in pots because I have to move them to another part of the yard so I can control how much sun they get. Most of them will move to the front yard to get morning sun and afternoon shade or they will be grown under the citrus trees which I prune to open up the middle. That is how I handle growing in the heat.
I plant tomatoes and eggplant in large pots 20 inch pots. The tomatoes are in cages. Self watering pots save water and cut down on BER. I only grow heat tolerant tomatoes or cherries in summer. They produce the best when it gets very hot. Eggplant does not mind the heat but I only need one or two plants since they are so prolific and they spread so take up less space in pots. Hot peppers don't mind the heat they have to be at least 70 degrees F just to germinate nicely and they produce prolifically. Bell peppers will stop producing in extreme heat but are good up until you get close to 90 degrees F. Most of the Mediterranean herbs with gray leaves don't mind the heat. Herbs are expensive to buy and add a lot of flavor to food so they are the best deal in a hot climate. Sage, thyme, rosemary, oregano, lavender do well even in hot dry climates. Basil, shiso, fenugreek, cumin, borage, and some of the other herbs like cilantro need more water and can be grown when it is cooler. Basil does o.k. in the heat, it just needs more water and bolts quickly.
I have an overhead trellis and a fence where I let the gourds and chayote grow. Those vines are over 50 ft long and they are better if the fruit are off the ground. I only grow sugar baby watermelon. I can't eat a whole large watermelon so the 11 lb sugar baby is a better size and the vines are only 6 ft. Still, it yields poorly 1-3 melons max per vine, usually 1.
During the hottest months, I only harvest. Planting is futile when it is 99 degrees F outside. Most plants don't like that. After I harvest. I add more compost and I solarize the soil. It amends the soil for the next time and solarization kills nematodes in the top 4-6 inches and keeps the weeds down. It also would require a lot of water to try to keep anything going in the middle of summer and we pay very high rates for water that doesn't even end up in the sewer.