For forces that change along the way, displacement is not the thing to calculate work with. Let $\gamma : [0,1] \rightarrow \mathbb{R}^3$ be the (closed or open) path that the particle the force is exerted on follows. Then, the work done along that path is
$$ W[\gamma,F] = \oint_\gamma \vec{F}(\vec{x})\cdot \mathrm{d}\vec{x}$$
which is a line integral. If $\vec{F}$ is conservative, there is a function $V(\vec{x})$ such that $\nabla V(\vec{x}) = \vec{F}(\vec{x})$, then we can apply Stokes' theorem (or, less fancy, the fundamental theorem of calculus) to calculate the work by
$$\oint_\gamma \vec{F}(\vec{x})\cdot \mathrm{d}\vec{x} = \int_{\partial\gamma} V(\vec{x}) = V(\gamma(1)) - V(\gamma(0))$$
For closed paths, $\gamma(1) = \gamma(0)$, so this is zero. If there is no potential with $\nabla V = \vec{F}$, we cannot apply this argument and have to actually calculate the line integral, which may be anything, especially not zero.
I'd be much obliged if someone could give me an example of such a
field
Consider a vector field $\vec F$ with non-zero curl in the $z$ direction only:
$$\nabla \times \vec F = \left(\frac{\partial F_y}{\partial x} - \frac{\partial F_x}{\partial y}\right)\hat z $$
An example of such a field is
$$\vec F = -y \hat x + x \hat y$$
which has curl
$$\nabla \times \vec F = 2\hat z$$
so $\vec F$ is non-conservative. By Stoke's theorem, for a closed contour in the $z=z_0$ plane enclosing an area $A$, the line integral along that contour will have the value of $2A$.
Clearly, for plane areas parallel to the $z$ axis, there is zero flux of $\nabla \times \vec F$ through, thus, the closed contour integral of $\vec F$ in such a plane will be zero by Stoke's theorem.
To verify, pick a contour within the plane defined by, e.g., $y = 1$.
Integrate the field along the path from $(0,1,0)$ to $(1,1,0)$ to $(1,1,1)$ to $(0,1,1)$ to $(0,1,0)$
There is no component of $\vec F$ in the $z$ direction so the only contributions are the integrals along the $x$ direction.
$$\int_0^1 (-1)\hat x \cdot \hat x dx + \int_1^0 (-1)\hat x \cdot \hat x dx = -1 + 1 = 0$$
So, this is a simple example of a non-conservative vector field and a closed contour integral in that field that is zero.
Best Answer
A field is conservative if and only if the work around any closed path is $0$. Therefore, if a field is conservative then the work around a single chosen path is guaranteed to be $0$, but this does not mean if we have a field and a single path has a work of $0$ that the field is conservative, as we have only checked one path, not all paths$^*$.
A simple yet contrived example is a a field described by $$\mathbf F(x,y)= \begin{cases} F\,\hat y, & \text{for $x\geq0$} \\ -F\,\hat y, & \text{for $x<0$} \end{cases}$$
You could look at the work done around a closed path where the sign of $x$ does not change and find that the work is $0$. However, if you look at the work done along a closed path where the sign of $x$ does change then you could get paths where the work is not $0$. An example of such a path would be a square path that is bisected by the $x=0$ line. Since we have found a closed path where the work is not $0$ the field is not conservative, even though there do exist closed paths where the work is $0$.
$^*$Of course, there are other ways to check if a field is conservative besides explicitly checking the work along every possible path.