It only matters if you have any morality since selling a company to investors for $10 billion when you know the wheels are about to fall off is not exactly the right thing to do.
This is capitalism. As people like to say, you're "obliged" to get the best deal for your current shareholders.
As long as you don't lie or omit required information, you're not required to point out that a particular growth metric is slowing down, and can point to a different one.
(and as one of the other comments has pointed out, quite often the acquirer will shut down the acquired)
I would hope as a CEO you would know of something major like the wheels falling off immediately after you exit. If the event was truly unknowable before you exited then you are morally fine, but to knowing exit when you know there are serious issues is not fine.
As long as everything is fully disclosed, an investor may purchase without recourse.
For example, M. Cuban achieved a $1 billion valuation of a company on $3.1 million in revenue and $2.7 million in net losses. This was transformed into a $5.7 billion exit months later. Yahoo's market cap was then chopped down by about 80% over the next few years.
There is still a moral duty of care towards non-sophisticated investors. You can make an argument that an investor that buys a company knowing all the risks and who is able to rationally evaluate the risk is responsible for their actions, but many investors are not able to determine the risks involved.