904 having problems after changing oil pan gasket ...

Sound like you have damaged the t/v linkage ( bent or sticking)so the trans thinks the throttle is open more than it really is. This will cause late hard shifts.Check that it moves freely and readjust.