If the creature targeted by Sleep with the Fishes isn't a legal target at the time it would resolve, Sleep with the Fishes is put into its owner's graveyard from the stack. It's not put onto the battlefield and then put into their graveyard. Notably, this means that its controller will not create a Fish token.