No no no. Luffy was off-guard and careless, so he got defeated. Once he was on-guard and not careless he mopped the floor with Caesar. With Doflamingo, he's been on-guard and he hasn't been careless, but he's still losing.
When it comes to Ace and Magellan, Teach has been the same. He was on-guard, but careless against both. On-guard but careless means he knew the enemy was there, he was prepared to fight, but didn't do what he supposed to do, he slipped up and let himself get caught. Examples of Teach being on-guard but careless is when he was caught by Fiery Doll and St. Elmo's Fire. The difference between Ace's and Magellen's strength is shown by the fact that several of Ace's techniques hit Teach while he slipped up, and was unable to put him down, while one technique from Magellan hit and took him down. That's why Magellan>Ace.