It's a risk because there are a ton of things that can go wrong with this kind of deal.
The new owner might be clueless and run the site into the ground.
The new owner has no great incentive to improve the site because it didn't cost them anything.
The new owner can fudge the numbers to decrease how much you're getting paid.
The new owner could just not pay you at all.
If you're going to go this route, make sure you're dealing with someone trustworthy, ethical and experienced.