We usually find that the code deployed has some errors, is it the job of other departments to verify that everything is working properly or is it the job the IT department to do the quality check and check their own work?
It depends on the company. Managers and bosses should have documentation saying what the departments of the company are, and what each one is responsible for.
An IT department should be responsible for doing their own quality checks before releasing software (Quality Assurance) however, there's a limit on what can be tested. Human error can't be completely eliminated, and only the recipient can confirm it meets their interpretation of the specification.
There are methods such as test driven development (TDD) and unit testing that can be automated with continuous integration, deployment and delivery pipelines (CI/CD). Implementing these methods can help reduce issues, but will never eliminate them completely.
Bugs are an accepted part of developing software and there should be very clear processes (ticket system / help desk) to deal with them.
In companies I've worked for, software is tested by the quality assurance department before release, and we always get the recipient (either internal department or a client) to sign off and confirm they've fully tested the software themselves and that it meets the spec before we release to production. This way if an issue is discovered, they can't just blame it all on us. They are also made aware of how to raise any support tickets if they find a problem.