Our dog has gone through some patches...
She is a very nervous dog, which just feeds into misbehaviour.
The majority of the time she misbehaves, I'm starting to realize it's just because she's afraid.
She's afraid of the hoover, flies, plates...just about everything. Yesterday I was trying to train her to run in and out of the sticks like in an agility course. I had her on the lead at first in our garden (3acres, no gate!) and told her to sit while I set it up.
My dad was clanging around in the back yard. The dog hated it. She was crouched to the ground and wouldn't stay still. So yes...I took her off the lead, thinking she'd be less nervous about it if she could move around. A few more crashes and she was off down the driveway, to the gate. I tried shouting 'dinner' which usually gets her right back

but nope. Our road is super dangerous. Only managed to get her back by sprinting around in the front garden. She thought I was having fun and cane back.
We have 6 people in our house, so we aren't very consistent. She also went through a phase of rolling over and biting (hard!) if she didn't want to come in or go in her crate. Unfortunately, while I would ignore her when she did this (no reward for bad behaviour) a couple of my family members would come up and either try to pick her up, or talk to her and stroke her.
By bashing a few heads together (brothers, not dogs) we finally managed to sort that out.
She's also terrible around other dogs and people. She runs away from any other dogs, be it a chihuahua or a great Dane, and we've also had some little problems of weeing on people. Yes...she isn't quite perfect yet

I don't know why she's so nervous. She didn't meet many people or dogs when she was younger, so that's probably a factor. She is a lovely girl though. If I pretend to drop a treat she sits by it and won't eat it.
German shepherds are lovely. Probably one of my top five favourites.