Many steps should have been taken...first the suggestion of a home inspection (which you did) clearly the door issue was identified. Check your inspection report to see if the switch was mentioned...if the house was vacant the inspector may not have been able to identify what the switch controlled...even if it was lived in, if nothing was plugged in to the switch it may not have been noticed, often inspectors will mention small items in their report. That is where a walk through is helpful...especially if you do it with the sellers present...you can ask questions about details of the house. There is a remote possibility the switch was never properly linked and the seller just never addressed it. Try to find a way to get answers and not a person to blame..you will probably find better success with the problems...neither seem worth any legal action...I am sure you just want them to work. Best wishes with your new home. If you need any referrals for contractors or electricians please let me know firstname.lastname@example.org.
No, the buyer's agent's role isn't that of a home inspector, just as the agent's role isn't one of a lawyer.
Sorry to hear of the things you have found out. Agents though, are not electricians and if your home inspector did not find these issues, then it is highly doubtful that your agent would have. It doesn't sound like they were being negligent, although that is a legal issue and should be discussed with the appropriate parties.
Technically also, the door would be an item of maintenance and not something structural, or mechanical. Although, since it was part of the addendum, it should have been taken care of. Did you do a final walk through prior to settlement? This may have uncovered what had not been fixed before.
You may want to contact your agent to discuss these things and the home inspector that inspected the home.
If you used a standard MAR contract, it states in there that agents are not deemed responsible for pointing those types of items out to you since that is not their area of expertise.