The gate can close earlier than 20 minutes to departure but only if everyone has boarded anyway. In practice that's the bus gates since the drivers will want to get going. The protocol is that BA services can't depart more than 10 minutes early at LHR, they can go sooner at LGW.