That’s what I’m wondering. Did Alam suddenly morph into Holmes?
Unlikely, unless to confuse the cops Holmes identified himself as "Alam" when he was arrested. That's the only non-conspiratorial explanation I can come up with.