This issue is a bit confused in textbooks, however the statement of the professor is physically wrong (mathematically all the procedure can be rigorously justified using the theory of distributions). The point is that the claimed position operator is not the position operator because it is not even self-adjoint (nor Hermitian) in the relevant Hilbert space of the theory. Actually I will not enter into the details and I just show the basic problem affecting these (quite popular unfortunately) ideas.
Let us start from scratch. If, taking advantage of the Lorentz invariant measure $\frac{d\vec{p}}{E(\vec{p})}$, you decide to write the field operator as
$$\hat{\phi}(x) = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} a_p e^{ip_\mu x^\mu} + a^\dagger_p e^{-ip_\mu x^\mu} \:,$$
where $\vec{p} \in \mathbb R^3$ is the three momentum while $p_0 := E(\vec{p}) = \sqrt{\vec{p}^2+m^2}$,
you see that the commutation relations $$[\hat{\phi}(t,\vec{x}), \partial_0 \hat{\phi}(t,\vec{y})] = i \delta(\vec{x}-\vec{y})$$ are possible if and only if (I omit some $(2\pi)^a$ coefficient)
$$[a_p,a^\dagger_q]= 2E(\vec{p}) \delta(\vec{p}-\vec{q})\:.$$
This means that the relevant momentum representation is not $L^2(\mathbb R^3, d\vec{p})$ but is its Lorentz-invariant version $$L^2\left(\mathbb R^3, \frac{d\vec{p}}{2E(\vec{p})}\right)$$
I mean that the amplitude of two momentum wavefunctions $\psi= \psi(\vec{p})$ and $\psi'= \psi'(\vec{p})$ is:
$$\langle \psi'|\psi\rangle = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} \overline{\psi'(\vec{p})} \psi(\vec{p})\:.$$
With this choice of the momentum representation the operator $i\frac{\partial}{\partial p_k}$ is not Hermitian because of the presence of the factor
$E(\vec{p})^{-1}$ giving rise to an obstruction for the integration by parts procedure, when trying to move $X_k$ from one side to the other side of the scalar product in order to prove that $\langle \psi'|X_k\psi\rangle=\langle X_k\psi'|\psi\rangle$ (wrong).
Indeed, the position operator along the spatial direction $x_k$ is defined by the Hermitian operator
$$\left(X_k \psi\right)(\vec{p}) = iE(\vec{p})\frac{\partial }{\partial p_k} \frac{1}{E(\vec{p})}\psi = i\left(\frac{\partial }{\partial p_k} - \frac{1}{E(\vec{p})}\frac{\partial E(\vec{p})}{\partial p_k}\right) \psi$$
that is
$$\left(X_k \psi\right)(\vec{p}) = i\left(\frac{\partial }{\partial p_k} - \frac{p_k}{E(\vec{p})^2}\right) \psi(\vec{p}) \tag{1}$$
This is the so-called Newton-Wigner position operator in momentum representation for a relativistic scalar field which is believed to be the right definition of position operator in relativistic quantum mechanics, if such a notion makes still sense in relativistic quantum mechanics. With this definition, it is possible to show that a position localized state $\psi_{x_0}$ when read in field representation $${\phi}(\vec{x}) = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} \psi_{x_0}(\vec{p}) e^{i\vec{p}\cdot\vec{x}}$$
gives rise to a field configuration concentrated around $x_0$ in a region with the dimensions of the Compton length of the particle.
It is clear that, with this (correct) definition of momentum operator, the claim of the professor is wrong because the extra term in the right hand side of (1) does not permit to achieve the (wrong) identity. $\hat{X}^k \hat{\phi}|0\rangle = x^k\hat{\phi}|0\rangle $
The general claim is also untenable because the component $\hat{X}^0$ should be interpreted as a "time operator" which as it known does not exist (Pauli's theorem).