What are the biggest factors that contribute to the cost? Is it mostly increased labor?
You can't run a harvesting tractor through a greenhouse. So, a lot of produce from greenhouses or vertical farms (etc) ends up with a manual harvesting step.
This is why you pretty much see greenhouses exclusively used for foods which would require that manual step anyways.
Sure you can. Just needs to be big enough.
Note that this is an area that is rather specialized - a pepper picking robot isn't good for tomato picking or lettuce picking ( https://youtu.be/EFC3OvkVKaQ ). Compare that to the incredibly versatile human ( https://youtu.be/oxbJVqfIK1U ).
It's similar to the "burger flipper robot" problem. Possibility solvable, but also gonna be costly and buggy for v1 of the robot.