Easy-plane to easy-axis anisotropy switching in a Co(ii) single-ion magnet triggered by the diamagnetic lattice