Networks & DBs present abstractions, but they're very leaky ones, yet developers often expect to just treat them as magical black boxes about which they don't need to know much of the inner workings, constraints, tradeoffs etc. That makes the interface between the network engineer or DBA and software developers a natural site of conflict.
(You even see this above in this very thread, someone complaining that a DBA was punishing developers for "querying the database too much". Most likely the DBA was actually upset about how they were querying the database, not that they were querying it too much, but the developers want it to "just work" so the distinction isn't important to them.)
[0] The mechanic is also being paid by you to fix your screwup, in proportion to the severity of the screwup. Your colleague is not.
The DBA's job doesn't generally extend to fixing your code to use database features correctly, write SQL in a sane way, etc. Even if it does at your company, unlike the mechanic they're not being paid by you to do that work; they get their salary regardless. So it's natural that if you keep bringing unpleasant work to them because you're bad at your own job, they're going to get upset.