Direct before the studio's automatic-locking system was permanently removed: "Do the studio windows lock automatically?" After its removal, which full report correctly removes do-support and backshifts the ended behaviour?
Explanation
The if-clause places the subject before locked and uses past tense because the automatic system had been removed. The competing forms retain did-inversion or combine did with a past-tense lexical verb, neither of which belongs in the embedded clause.