The longitudinal cars underwent a major design change with regards to the eng/trans mounting, spacing, and steering/suspension. You cannot mix 'n match many parts because of this. They redesigned the gearbox (both manuals and automatics) such that the centerline of the front axle and the outlet flanges on the gearbox are right up against the engine, and the flywheel is actually
behind this point.
The 2009 Audi A4 is the later type, so you cannot really use its transmission. It wouldn't easily bolt into the car, and the axle flanges would be in the wrong place.
View attachment 139053
View attachment 139054
Upper is the newer type (notice where the drive flange is)... the lower is the older type, with the differential (and thus the output flanges) behind the clutch/flywheel. It is a very different arrangement. At the same time, they also completely changed the way the powertrain mounts to the car, they moved the steering rack down below the powertrain and mounted it to the subframe, whereas previously it was up in a cavity against the firewall.