Different engine here (30d with 33k miles on it) but I believe the same ZF 8 speed as you.
My gearbox is not that smooth when cold and hangs on to 2nd or 3rd gear when accelerating gently. It's not jerky (as such), but you definitely feel it's cold. Give it a few miles to warm up and it's fine. Put the car in Sports+ and Sport gearbox and it is a bit jerky, but not in a bad way
I have a friend that has owned X5, 5 series, 7 series all with the B57 engine and ZF 8 speed and he swears by the gearbox.
I'm sure other M40i owners will report similar, but obviously get it checked out by BMW or specialist if you're worried.
J.