Is this sentence correct?
去年は日本へ行ったことがあります。
Is this sentence correct?
去年は日本へ行ったことがあります。
「[去年]{きょねん}は[日本]{にほん}へ[行]{い}ったことがあります。」
If I had to label this sentence as either 'correct' or 'incorrect' and nothing in between , I would certainly go with 'incorrect'. At least, this is not a sentence that a careful native speaker or writer would produce in a natural setting.
Problem #1: 「去年は」
To use 「は」 correctly with a time word, you need to be comparing two or more time frames. If you are talking about where you went last year and where you went the year before, for instance, you can use this 「は」.
Another correct usage of 「去年は」 is when you want to topicalize "last year" and list the things that you did within that particular year.
For simply stating "I went to (place) last year.", however, we normally would not use 「去年は」. We would just use 「去年」.
Problem #2: 「行ったことがある」
「ことがある」 expresses one's past experience in doing something. The time frame is between your birth and the present moment. In English, one might say "I have been to China twice.", "Have you eaten crocodile meat before?", etc. That is the general feeling of 「~~たことがある」.
To simply state that you did something, for instance, 'yesterday' or 'last year', you would not use 「~~たことがある」. Instead, you would use the simple past tense as in 「行った」,「[食]{た}べた」,「[見]{み}た」, etc.
So, the "correct" sentence meaning "I went to Japan last year." would be:
「去年日本に(or へ)行きました。」
Exceptions:
Native speakers occasionally DO USE 「~~たことがある」 in retrospect with a time word when talking about something that one did at least a few years ago.
We might say: 「10[年前]{ねんまえ}にハワイに行ったことがありますが、とてもよかったです。」, and not many people would think anything of it.
But only a very small group of people would say: 「去年ハワイに行ったことがあります。」
Practically no one would say 「去年はハワイに行ったことがあります。」. That would just sound so unnatural coming from a native speaker.
Saying [動詞の過去形+ことがある] pretty much means "I have {verb} before"
Your sentence is akin to saying "Last year I have {verb} before" which doesn't make sense, as "done {verb} before" is a generic past tense phrase that doesn't refer to any specific point or period
It's the same in Japanese. You're essentially using a specific point in time or time period which refers to the past in a general way.
Hopefully that makes some sense :P