We have experience with a pitch of 0.5 mm, and that works fine. A pitch of 0.4 mm should still be possible, but we advise to make the pads in the stencil 5% smaller