Radial and vertical constraints on the icy origin of H2CO in the HD 163296 Protoplanetary Disk