Vergo went to the secret room to confront him, I'm pretty sure Caesar gave Vergo Law's heart a couple chapters ago, and Law used shambles to "rearrange it's position"
"I got my heart back from Caesar, but I didn't count on you showing up, Vergo"
This sounds to me like he already had the heart, then Vergo took it prior to their engagement in this chapter.