The door lock assembly houses the "door closed" switch. Part# 51-21-7-036-167. The new BMW cars have gone away from using mechanical switches and instead it is a hall effect device. Your diagnostic seems logical to me, if the window wont go up all the way, I would suspect the passenger door lock is faulty, however, the system is readable for faults with the proprietary BMW software and I recommend reading out these faults before the repair attempt is made.