Could I make a world where gorillas replace elephants in their niche as herbivore? Are there any reasons that they could not?
Imagine the Gorillas as Giant Sloths
First off, sloths were giant ground based herbivores, like elephants. Megatherium, pictured here in lo-fi, had a body length around 6 m, and estimated weight of up to 4 tons, comparable with the Indian elephant.
We can then note that the gorilla's body plan is roughly similar to the sloth's. The gorilla does not have a tail, and has a different shaped head, but it is very similar regarding locomotion. Sloths walked plantigrade on the their back legs, just as gorillas, and they walked on their front claws, as gorillas knuckle walk.
Gorillas are already well adapted to eating large quantities of low grade vegetation, which is an important precursor to large size among herbivores. Their relatively dexterous limbs could be used competitively with an elephant's trunk or a giraffe's neck and tongue for reaching food in high places.
Overall, the gorilla is pretty easy to imagine as a mega-herbivore, following the plan of the giant sloth.
You want a gigantopithecus. These were real hominids in the orangutan line. I find estimates of 10-12 feet tall and 1200 lbs. Their teeth were flat, like elephants and other big herbivores. They ate a lot of bamboo.
I wonder if they had the same trouble as pandas - a low calorie vegetarian diet without the specially adapted gut of longstanding herbivores like ruminants.
One way to get around that is to be big and so be able to take in huge amounts of food. A problem with being big is that fertility is low and individuals have one baby at a time, spaced far apart. The proverbial all eggs in one basket: if you lose the baby you lose a big piece of your lifetime fitness which is one problem pandas have. Good insurance against that is sociality and care of young by more than one individual. Like humans do. And elephants. Not orangutans so much but gigantopithecus definitely should.