Presumably, the question you answered was off-topic at this site, otherwise it wouldn't (or shouldn't) have been migrated away. At least, that's what the FAQ on migration says:
Don't migrate for the sake of migration. We only migrate questions because they are off-topic on the original site. It is perfectly possible for a question to be on-topic on multiple sites, but that is not a reason to migrate it elsewhere. As a general rule, if someone asks a question here, and it's on-topic here, it should stay here.
Normally, off-topic questions are closed and eventually deleted, along with their answers. However, since the question you answered was on-topic at another SE site, it was migrated there instead. Your rep for the answer that you managed to post before the migration went along with it — if you wish to reclaim it, you can sign up for an account at the other site.
As Dave Tweed notes, this is how it's meant to work: you rep on any given site is meant to reflect your on-topic contributions to that site.
To illustrate why that's how it should be, let me give a hypothetical example. I know quite a bit about programming, and currently have 32k rep on Stack Overflow. On the other hand, I know essentially nothing about Buddhism, and I don't even have an account on Buddhism Stack Exchange (even though I do have quite a few accounts on various SE sites that I've never used for anything other than flagging spam).
Now, suppose some confused user happened to ask a programming question on Buddhism.SE, and I just happened to notice it, and registered an account and answered it there before it was (closed or) migrated to SO where it belongs to. (We all know that some SO users are clueless, and will ask programming questions on any site that even vaguely looks like SO.) Let's also assume that, if nothing else, the OP managed to accept and maybe even upvote my answer on Buddhism.SE before their question was migrated, so that I gained some rep from it. In that hypothetical scenario, should I really get to keep any rep points on Buddhism.SE that I might have earned from that answer, even though it had nothing to do with Buddhism?
Of course, your actual case was (presumably) not quite so clear-cut, since you say that your answer had 10 upvotes when it was migrated, suggesting that at least some other users thought that it was both good and on-topic here. (It's also possible, of course, that the upvoters were visitors from other SE sites via Hot Network Questions, and therefore not so familiar with what's on-topic here, or that they simply upvoted your answer because it was good even though it was also off-topic, with the expectation that it would eventually be migrated to a more appropriate site.) But in any case, the basic principle holds: if the question does not belong on this site, then neither do the answers, or the rep earned from them.