BMW of North America (BMW) is recalling certain 2022 4 Series Gran Coupe (430i, 430i xDrive, M440i xDrive); 2019-2022 X5 sDrive40i, X5 xDrive40i, X5 xDrive50i, X5 M50i, X5M; 2021-2022 X5 xdrive45e; 2020-2022 X6 sDrive40i, X6 xDrive40i, X6 xDrive50i, X6M and 2019-2023 X7 xDrive40i, X7 xDrive50i, X7 M50i, X7 xDrive60i, X7 M60i, X7M, Alpina XB7 vehicles. The roof function control unit may be programmed incorrectly, allowing the sunroof to close without the key fob present inside the vehicle. As such, these vehicles fail to comply with the requirements of Federal Motor Vehicle Safety Standard number 118, “Power-Operated Window Systems.”