My two theories are: Ace is stronger than Law or Blackbeard getting the Gura Gura no Mi made him weaker. Here are the two theories:
Ace is stronger than Law. Ace held his own against Blackbeard, Blackbeard using the Yami Yami no Mi. Sure Ace eventually lost, but he managed to survive a while. Meanwhile, Law lost to Blackbeard, Blackbeard using the arguably weaker fruit in his arsenal, the Gura Gura no Mi. For Law, when Blackbeard started using the Yami Yami no Mi, Law lost the battle. If Ace can hold his own against the Yami Yami, and Law can’t, Ace must be stronger. Following this theory, these characters should be stronger than Blackbeard: Mihawk, Kaidou (easily), Big Mom, Dofi (possibly?), Shanks (even with one arm), Zoro, Luffy (easily), Rayleigh, Aokiji, Van Auger (possibly), and maybe even Killer. From the marines, this theory makes the following characters able to beat Blackbeard, Akainu, Rob Lucci, Kizaru, Fujitora (with struggle possibly?), Sengoku, and Garp.
Now my other theory is that having the Gura Gura no Mi made Blackbeard weaker. If Blackbeard needs to use the Yami Yami to beat Law, with the Gura Gura still having a lot of power, then Law and Kid could beat with him some trouble, but still come out on top. This would also mean that Ace and Law are more equal in power. This theory makes sense because Law is an extremely strong fighter, and still lost. If Blackbeard got weaker it would also mean Law isn’t as strong as we thought he was, because if Blackbeard got weaker Law could probably do better than he did against Blackbeard.