I’m going to make an assumption that your mechanic got “lazy” and installed the pinion nut with an impact wrench. these should be torqued to a specfic amount as there is a crush washer behind it, and it alters where the pinion gear is positioned into the differential gear or ring gear. if its left too loose or too tight, the gears don’t mesh well together in that “sweet spot” and can cause a whining noise during acceleration or deacceleration or in severe occuances, full-time. most backyard or do it yourselvers throw the parts in and bolt it up and drive it, there is a process to installing gears where you need to “chalk” the gears, install the differential, rotate it to wear the chalk and get a read on where the gears are meshing, if its wrong you tighten the pinion a bit more, (or remove it and replace the crush washer and start again) and continue to clean, chalk, rotate, check, adjust rinse and repeat until its right. downsides are its a pain in the rear. “<—bad pun" and a time consuming job, but if left alone it could prematurly wear out the gears, or over heat seals and bearings and cause a leaky seal or a failed bearing. worst case senarerio, the bearings wear out, overheat and lockup gernading your rearend and rolling to a stop, or causing more damage to the drivetrain from the internal transmision parts to a broken driveshaft, to broken axels. or it could run for many miles with that whine. could go either way. depends on the extent of the condition/s and driving habits.
i know you said you just had the axle changed and not the gears/differential, and removal of the pinion is not required to change an axle, but the front pinion seal may have been leaking and he may have replaced it while everything was being worked on.