Just to say that, AFAIK, apparently double dative (に) with an accusative passive (i.e., where the を-marked object moves to が), as in *そのことが 私に あの人に 言われた, is mostly considered agrammatical. It’s possible only if you drop the “by” dative (“by me”), giving そのことが あの人に 言われた, in which case the meaning will be “that thing was told to him”.
Source/more info
See for example section 3.3.2.1 in Ishizuka’s thesis Toward a Unified Analysis of Passives in Japanese: A Cartographic Minimalist Approach, where the following rule is proposed:
In Japanese passives, whenever the complement of -rare is a (pseudo-)ditransitive verb, the dative phrase in the passive is interpreted as the internal dative argument and not as the external argument.
In layman’s terms, it says that if you put a ditransitive verb (=has direct and indirect objects) into the passive, the result can carry a single dative (に-marked) argument, and that has to be the “natural” argument of the verb when it’s in its active form (i.e., the addressee, in this case).
The way I see it, this alone does not, however, invalidate Nenad’s original interpretation, I think, although I agree with Saida and you that the natural interpretation is to have an indirect passive (私が) あの人に (その)ことを 言われた => あの人に (その)ことを 言われた こと (drop implicit subject; relativise by extruding object こと).
Compare that to Nenad’s interpretation, where it was the subject that was extruded: そのことが あの人に 言われた => (その)ことが あの人に 言われた こと.
As to why the first interpretation is more natural than the second, I’m not quite sure. If I had to guess, I’d say it may be due to how we process sentences. One possible explanation would be that when we encounter the first part あの人に 言われた, we instinctively fill the empty subject with 私 as a default subject in the absence of context, as if it were a standalone sentence (私が) あの人に (それを) 言われた. And then we see こと and backtrack minimally to fix the sentence by assimilating it to the missing object. But that’s just some random hypothesis I just made up (and I know next to nothing about sentence processing), so take that with a grain of salt. (Look, @riya, sentence processing! psycholinguistic digression! )