According to this Apple Support page, the best approach is to wait for your MacBook to shut down before closing its lid if you want to make sure it has properly shut down.
Important: If you’re using a Mac notebook computer, wait for it to shut down completely before closing the display. If you close the display while the Mac is shutting down, it may not shut down properly and may start up more slowly the next time you turn it on.
My 2-year old MacBook Pro has always shut down properly in my experience when I closed the lid after asking it to shut down but my situation might have been helped by the fact that I always quit all open programs, except the Finder which of course can not be completely quit, before giving the shut down command. It is possible, for example, that some open program, which does not automatically save your work and has unsaved work at the time, may prevent your computer from shutting down and then your computer would simply go to sleep, instead of shutting down, because the lid is closed.