It's fine to pitch and then shake, I do it all the time to make sure there's no yeast stuck to the sides of the carboy that doesn't get down to the wort. You just don't want to shake after fermentation has begun, because it could lead to the possibility of oxidation.
Although, this is very unlikely, because the carboy is filled with CO2 after fermentation, so it would require you to remove the airlock and stopper, or shake it after or while transferring. Shaking a little after fermentation has started is perfectly fine, and sometimes helps to keep flocculant yeast in suspension so they can finish their job.