Those definitions are a little ambiguous.
If by complex, you mean that your websites will do heavy calculations / algorithms, you definitely want to go custom....
If, however, you just mean that you want some CRUD (create, retrieve, update, delete) via an admin, and maybe the addition of other common functional website modules, Joomla is fine (though not my top choice of CMS).
If by "really works well", you mean that it is high-performance, and can handle a significant load of traffic without any problems, or that it's coded by professionals and employs the best usability or coding-style techniques, you definitely don't want to use any OS solution. I've been working on optimizing a Joomla website this week, for example, and the home page alone performs 120 individual database queries!!!! ONE HUNDRED TWENTY!!! And it loads 43 individual JS & CSS files FORTY THREE!!!! That's what you get with a CMS - added complexity = added inefficiency.
If, however, you just mean that it's mostly bug-free and does what you expect it to do, then an OS solution is fine.
A final comment - with a CMS, your interfaces won't be as "custom" or "tweakable" as with a custom solution... unless you get into the code and hack away at the default coding. Your DB will never be optimal for performance, and your HTML will never be optimal for SEO (Wordpress+Thesis is actually an amazing exception that's really awesome for SEO, though). That's not the purpose of a CMS - they're designed to be quick ways to get a website live with lots of functionality, or for people who don't know anything about programming to develop a functional website.