In the following sentence, the combination of の and に allows it to be interpreted in two ways:
この巨大なネズミは他の地域に生息する固有種に比べれば小柄。
この巨大なネズミは(他の地域)に生息する固有種に比べれば小柄。
Compared to the endemic species in other regions, these huge rodents are small in size.
この巨大なネズミは他の(地域に生息する固有種)に比べれば小柄。
Compared to other endemic species in the region, these huge rodents are small in size
This sentence is a little bit simplified from the original in here, but it should have the same general structure. Reading a bit more into the story, it seems like the second interpretation of the sentence is the correct interpretation.
My question is: Is there a rule for which way it should be interpreted? So, essentially, is this sentence ambiguous? And if it is, then is this just bad writing because it's a web novel, or do these kinds of sentences show up in polished literature?