Here's an alternative way to view the situation:
Both aldehyde/ketone C=O groups and also C=O groups in acyl derivatives (like CO2H) are electrophilic. Both undergo nucleophilic attack by, e. g, Nu:- (like an alkoxide ion), upon the electrophilic carbonyl carbon atom. As you pointed out, the C=O group opens to Nu-C-O-.
The difference lies in the fate of the Nu-C-O- anion.
With aldehydes and ketones, the group attached to the Nu-C-O- carbon atom is either hydrogen (aldehyde) or an alkyl/aryl group (ketone), neither of which are suitable leaving groups.
However, with acyl derivatives (like CO2H), the group attached to the Nu-C-O- can function as a leaving group (OH- in CO2H, or possibly neutral OH2 if acid is present).
Thus, aldehyde and ketone C=O groups undergo addition of the elements of Nu-H across the C=O double bond, whereas acyl C=O group undergo a two-step addition-elimination sequence.
So, with an aldehyde or ketone as substrate and alkoxide as nucleophile, the reaction results in initial formation of a hemiacetal via addition of the elements of RO-H across the C=O double bond.
With RCO2H as substrate, addition of Nu:- (like alkoxide ion) occurs in the first step, which is followed by elimination of OH in the second step thereby resulting in net substitution of OH by Nu to afford RC(=O)Nu. In the case of alkoxide ion as nucleophile, the reaction results in ester formation.
Hope the foregoing is clear. It's much easier to see when written out in typical organic reaction mechanistic fashion, curly arrows and all.