Ball lost in water then found
If you were then you proceeded correctly.
However if you weren't virtually certain then Decision 26-1/3.7 - Ball Dropped Under Water Hazard Rule Without It Being Known or Virtually Certain Ball in Hazard; Original Ball Then Found - applies. This is a bit more complicated.
"Q. A player’s ball is struck towards a water hazard and is not found. It is neither known nor virtually certain that the player’s ball is in the water hazard, but he drops a ball under Rule 26-1b. Before he plays the dropped ball, his original ball is found within the five-minute search period. What is the ruling?
A. It was neither known nor virtually certain that the player’s ball was in the water hazard when he put the substituted ball into play, and, therefore, that ball was incorrectly substituted under an inapplicable Rule.
The player must correct his error under Rule 20-6 by abandoning the substituted ball and continuing play with the original ball. If the original ball was found inside the water hazard, the player may proceed under Rule 26-1.
If the player failed to correct his improper procedure and played the dropped ball, he has proceeded under an inapplicable Rule and incurred a penalty (see Decision 34-3/6). The ruling would be that the player has proceeded under Rule 27-1 (the only Rule that applied to his situation), incurring the one-stroke penalty under that Rule. Additionally, as he played the ball from a wrong place (i.e. a place not permitted by Rule 27-1), he incurred the general penalty, loss of hole in match play or two strokes in stroke play, for a breach of Rule 27-1. In stroke play, the Committee must determine whether the player committed a serious breach when he played from the wrong place (Rule 20-7c)."
There is a lengthy description of what constitutes "known or virtually certain" in Decision 26-1/1 - Meaning of "Known or Virtually Certain". The essence is that "when all readily available information is considered, the conclusion that there is nowhere that the ball could be except in the water hazard would be justified".
It also says "In determining whether “virtual certainty†exists, some of the relevant factors in the area of the water hazard to be considered include topography, turf conditions, grass heights, visibility, weather conditions and the proximity of trees, bushes and abnormal ground conditions."
So it depends on whether you were entitled to conclude that the ball was in the hazard. From what you say, given the consensus that the ball was lost in the hazard I would say that you were. The fact that the ball was actually found outside the hazard doesn't alter the fact that you may have been "virtually certain" that it was in the hazard.
I love golf. Such a simple game!
Makes working out the Offside or LBW laws seem like nursery school.