A police officer who died after having a suspected medical episode on duty was executing a search warrant in connection with an ongoing robbery investigation in North York, Toronto police confirmed Thursday.