Whether consistency is ensured at the application level or the database level, mistakes can be made. Someone can forget to set things up in a schema correctly in exactly the same way they can forget to implement things correctly at the application level.
Also, even with relational databases, there are many times when you need to use transactions to prevent certain types of inconsistencies, they don't protect against everything.