It's not a coincidence that we got the same result each time.
It turns out that is a trig identity.
The proof is shown in the steps below.
One of the many trig identities
Plug in A = x+5pi/6
Use the identity cos(-x) = cos(x)
Use the identity cos(x) = cos(x-2pi)
This confirms that sin(x+5pi/6) and cos(x-5pi/3) are the same thing, but in different forms of course.
It's like saying how x+x is the same as 2x.
Cosine is a phase-shifted version of sine (hence the name "cosine" means "cofunction of sine").
If you were to start with sin(x) and apply a phase shift of 5pi/6 units to the left, then you would end up with sin(x+5pi/6)
Now if you were to start with cos(x), and apply a phase shift of 5pi/3 units to the right, then you'd get to cos(x-5pi/3)
Both of these result functions land on the same exact curve.
I recommend using either Desmos or GeoGebra to interact with these curves as described above.
A non-visual approach to "seeing" how the curves are the same is to generate a table of values. You should find that both sin(x+5pi/6) and cos(x-5pi/3) produce the same output for any given x input.
This of course does not constitute a proof (use the steps shown at the top of this section for the actual proof), but rather is a numerical example to help cement the idea of what's going on.