Poincaré–Hopf theorems on singular spaces