Is が wrong in sentences like 私がplaceに行ったことがある?


I saw someone getting corrected for using が in a ことがある sentence, and I was
wondering why using が in sentences specifically like _**私がplaceに行ったことがある**_ is
wrong, I can't seem to wrap my head around it.

I was thinking of some things like 私があそこに行ったこと which seem to be correct (in my
mind). But I'm confused as to why it was considered wrong?

Edit: Changing が with の seems to reveal how it's wrong, I think because the は
that is used in the relative clause is the topic and not the subject that does
the verb, is this understanding correct in any way?




> 私は日本に行ったことがある。  
>  I have been to Japan.

In this sentence, 私 is the topic of the entire sentence, and it's not in any
relative clause. (Very literally: "As for me, a having-gone-to-Japan [fact]
exists.") Structurally, this is yet another "double-subject" sentence (`Aは +
Bが + predicate`) such as 彼は背が高い, 今日は仕事がある or このレストランは料理が美味しい. Naturally, 私
must be marked with は.

If が is used instead of は, it would work as an exhaustive-listing が ("It's
_me_ who has been to Japan"). This is still grammatical but makes sense only
in a special context.

When you wrap this entire sentence in a subordinate clause...

> 彼 **は** [私 **が** 日本に行ったことがあること]を知らない。  
>  He does not know [that I have been to Japan].

Now, you must say 私が because 私 is in a subordinate noun clause (marked with
the square brackets) and the topic of the main (outermost) clause is 彼.




> 私は日本に行ったことがある。  
>  I have been to Japan.

In this sentence, 私 is the topic of the entire sentence, and it's not in any
relative clause. (Very literally: "As for me, a having-gone-to-Japan [fact]
exists.") Structurally, this is yet another "double-subject" sentence (`Aは +
Bが + predicate`) such as 彼は背が高い, 今日は仕事がある or このレストランは料理が美味しい. Naturally, 私
must be marked with は.

If が is used instead of は, it would work as an exhaustive-listing が ("It's
_me_ who has been to Japan"). This is still grammatical but makes sense only
in a special context.

When you wrap this entire sentence in a subordinate clause...

> 彼 **は** [私 **が** 日本に行ったことがあること]を知らない。  
>  He does not know [that I have been to Japan].

Now, you must say 私が because 私 is in a subordinate noun clause (marked with
the square brackets) and the topic of the main (outermost) clause is 彼.

