Where did those nutrients come from?
Plants can gather carbon (CO2) from the air. But the Nitrogen cycle requires micro-organisms to capture air and sequester it into the plants roots (or alternatively, nitrogen-based fertilizer).
But C and N are just two of the macro-nutrients needed to grow a plant. You also need Phosphorus, Potassium (NPK == typical fertilizer), Sulfur, Calcium, Magnesium (secondary macronutrients).
Then depending on the plant, you'll need Iron, Molybdenum, Boron, Copper, Manganese... a lot of different micro-nutrients.
You can pump these micronutrients into a hydroponic solution and grow plants in it. Or... you can buy 50+ Acres of land over there for just $10,000 with literally free energy, all the micro-nutrients automatically there from the sun to grow the plants.
The macro-nutrients are used in significant enough numbers you need to sow them into the ground every year. You can get the macro-nutrients from pretty cheap material: worm castings, pee tea, and chicken / horse manure, blood meal, and compost.
There's a reason why people farm in the farmlands. Land is cheap, Chickens are noisy and no one is allowed to keep a coop of chickens in the middle of NYC (you'd keep your neighbors up and people would complain about the smell and noise). Sowing the land with literally animal poop is extremely smelly and no one wants to live next to that.
--------------
If you create an indoor farm, you're competing against farms with literally free solar energy that's roughly 400% more effective than solar panels, as well as macro-nutrient sources that are cheaper than whatever hydroponic chemical solution you can ever hope to batch up. Direct sun is extremely bright.
IIRC, the sun's energy is measured to be around 2000 PAR/m^2 on a typical day. Your typical indoor light is only 200 PAR/m^2, while the more expensive ones may reach 500PAR / m^2.
The common refrain among growers is that the sun on a cloudy day (!!) is still more effective than any LED lamp.
Indoor farms run their weaker ~500 PAR/m^2 lights for 14-hours a day, starting before sunrise and long after the sun has set to maximize their use. That's the only way plants get enough energy from these lower-intensity light sources.
There can be something said about saving on transportation costs + having fresher food inside of cities. But its grossly inefficient from an energy standpoint.
-------------
Whenever I crunch the numbers, it seems like growing any plant in an agricultural zone, then shipping that plant into the city, is the most efficient strategy. Rooftop gardens would be the 2nd most efficient strategy.
Indoor farming conserves land, and maybe rich / expensive cities it makes sense as a source of fresh food for rich people. But indoor farming does NOT scale.