I'm sorry you find yourself in this situation, but you were banned from the Schengen zone by a member country and didn't know how long it was for? That's not on your lawyer, but on you. However, this may help.
While you are asking the question about Germany, I'm not good enough at reading german-language websites to get the German-language, specific region information, but it appears to have been widely standardized across the EU (identical across the six countries I checked). A lawyer should be able to tell you if this is correct for your circumstances.
Regarding an entry ban, return decision and pronouncement of undesirability, if your legal residence has ended or you do not have lawful residence in the Netherlands, you must leave the country. In addition, an entry ban, return decision or a pronouncement of undesirability can be imposed.
An entry ban prevents you from travelling to the Netherlands, other EU/EEA countries and Switzerland. You are not allowed to be in these countries either. You get an entry ban from the IND, the Aliens Police (AVIM), Seaport Police or Royal Netherlands Marechaussee (border police).
- 1 year: in case of an overstay of more than 3 days and up to 90 days.
- 2 years: the standard length (for example in case of an overstay of more than 90 days).
- 3 years: in case of a prison sentence of less than 6 months.
- 5 years:
- in case of a prison sentence of 6 months and more.
- when you have made use of false or falsified documents, or documents that do not apply to you.
- When you have previously been notified to leave the Netherlands and you have not done this (return decision).
- entering or staying in the Netherlands during the length of an entry ban.
I assume you ended up in prison, used someone else's documents or were told to leave Germany and didn't. Now you've entered Germany during the length of an entry ban and received the automatic 5 years - the German authorities don't care if you didn't check before you broke the rules, however opening dialogue is your best bet at this point.
Regarding the normal reasons for long bans, you may be wise to put together documentation showing you're now of moral character and an upstanding citizen able to contribute usefully and who'll be a benefit to the Schengen zone while you're in it. If you can't do that, enjoy visiting Germany in 2023 when your ban expires - just don't try to do it on the 1st Jan. You should have a piece of paper telling you how long your previous entry ban was for and the date it expired, however - and if you never received this and can prove both that you never received it and that you had no way to access the information about the ban duration and entered Germany in good faith, some leeway may be granted if you get through to the right person with the right powers on the right day. After all, immigration officers are only human - well at least some of them are!