That would have set me off in a bad way. Would not have beat the dog but there definitely would have been yelling / screaming and a long timeout in the crate. It would have been made very clear to the dog that doing that inside the house like that after I just took them out was NOT COOL.
(exceptions to that rule of mine at end of this post that many here may not approve of with their Dobermans - whatever - My dogs so it is My rules and what I am willing to allow around here)
Generally I don't do that 20 minute long potty break stuff ever. Especially not at 4.5 months of age or older.
When you have a dog on a regular feeding schedule you ought to be seeing a fairly regular pooping schedule to go along with it. I can darn near set my watch by what times of the day my girls are 'ready' to go poop and those breaks take a very few minutes at most. The majority of the time - Pee breaks for both my girls at the same time are less than a minute. We didn't go outside to smell the flowers - We went out there to pee. If they have no pee in that minute then we are going back inside.
First Doberman the wife and I ever had was a puppy during the winter. We didn't pre plan out 'potty words' at the time but it happened to work out that when either of us took that dog to go we would both end up telling it to 'hurry up' as it was doing its potty thing (duh -it was COLD outside!). Summer time the following year comes around and had the same dog out on a potty break, got tired of waiting and told her to 'hurry up' and bigger than life that dog copped a squat and looked over at me (nothing coming out). Dog was trying to communicate that she understood what I was asking her to do but that she just did not HAVE any pee to come out. For me the light bulb lit up that told me that the dog understood what I wanted to see so she 'tried' the best she could.
Dobies are not dumb. They can very easily learn to associate particular words with particular actions (and bodily functions like pee and poop). You would be wise to pick a word (or words) to use every time you see (or expect to see) a pee or a poop and use those same words every time you see the action. Out of habit I always stuck with 'hurry up'. That means pee
or poop to MY dogs. If I see one pee I will say 'Good Pee!'. If I see one poop I will say 'Good Poop!'. Again they are not dumb. If you use the same words over and over for the same actions - Eventually they WILL put things together and associate the words with the actions.
As a general rule around here I am expecting that if I do my part (with the words) that they will have potty commands figured out by 1 to 2 yrs of age. A simple potty break should not be taking longer than a few minutes so long as they are on schedule and there are no health issues messing things up.
FWIW - My last rescue dog learned the potty words and began to associate them with the actions in a few months of going on potty breaks with the Dober girls that were already trained to potty on cue. That dog would hear the words and see those girls cop their squats and do the actions and she figured out the association in no more than a few months (monkey see - monkey do training) vs a year or more of that training from nothing with the Dober girls. She was hearing the words - Seeing what they did in response - and THEN seeing the praise they got after performing the requested action and she picked up on it in a heartbeat!

(dogs are not dumb)
That rescue got the same exact potty schedule and routine as the Dober girls did from the get go. If it was time to go out they ALL went out at the same time and they all had the same length of time outside to either go potty or not. Blew my mind how fast that dog picked all of that up.
Exceptions to my 'fussing at the dog for crapping in my house' comments above -
Depends on 'where' the accident happens.

Lots of people have small dogs (which make for small pees and poops) and have no problems training them to go on pee pads inside their homes. Not a lot of waste to clean up as compared to a Doberman but consider for a minute how much better it is for the dog if they know for sure that they have a particular spot or area somewhere where accidents will NOT get them any grief. Could be a pee pad, could be a crate, could be a piece of cardboard, could be one room that has a particular tile or surface that separates it from the other rooms.
From day one with my current girls any and all accident in their crates caught them ZERO grief.
I is 100% on board with teaching Dobermans simple stuff like 'where can you have an accident inside my home' and me not be bothered by it things that the smaller breed owners don't hesitate to even think about.