Devil's are conniving but they can be dumb as hell when they themselves are being tricked. There's even this other story of a devil and a farmer who made a deal about what grows in this land. The human was smarter and the devil ended with the bad side of the deal.
I’m sorry but why is everyone pitying the grand devil? He deserves this, and if you think not then please remember the farmer story (/TДT)/