You can absolutely do agriculture near oil and gas wells. I grew up next to land routinely leased to ranchers. That land was spotted with lots of active oil and gas wells. The cows would eat our flowers whenever they got out due to the oil company leaving gates improperly secured. Today I drive past fields of sorghum, corn, and wheat with little spots where active wells operate. Once drilled they usually don't take that much space to operate.
https://www.sciencedirect.com/science/article/abs/pii/S03014...
Credit to our current system, if there was a need to cut back, we have a lot of easy cuts to gain some wiggle room.
It's still farmland! They're just farming energy now.
Where are you seeing healthy forests or other "beautiful land" being destroyed for solar farms? There's plenty of low-yield farmland and other similar land that's already been denatured by industry out there, lots of which already has major transmission infrastructure nearby, beautiful land tends to be expensive, and clearing trees costs money. It just doesn't make sense to do something like that outside of isolated areas where there's no other choice.
Here in the midwestern US every single solar or wind farm I've seen has either been on active farmland, former farmland, or a corporate/university campus.
https://www.carbonbrief.org/qa-what-englands-new-land-use-fr...
Also see the amount of land used for beef and dairy. Before industrial farming, Britain was a rainforest.
I live next to 200+ acres of solar farms. A part of me cries a little when I see so much beautiful land and trees cut down and these lifeless panels taking up so much space. We have so many buildings, and structures already (think parking decks, tops of apartments, homes, offices, even parking lots) that we could put these, but instead we cut down acres of trees or use up perfectly usable farmland.