Technical note: Nationals of country B are not issued a 90-day visa upon entry to the Schengen area; rather, they are allowed to enter without a visa. That means that country B is an "Annex II" country. When you leave the Schengen area with your Annex II passport, the border guard will probably notice the lack of an entry stamp and consider whether to impose a fine or other punishment because of a possible overstay. At that point, you will of course mention that you are an EU citizen.
The free movement directive, 2004/38/EC, provides in Article 5(4) that an EU citizen who does not have a passport or ID card, and who wants to enter the territory of a member state, shall have
every reasonable opportunity to ... corroborate or prove by other means that they are covered by the right of free movement and residence.
The Freizügigkeitsbescheinigung and the records showing that you have applied for a replacement passport should presumably suffice in this regard.
That covers your return to the Schengen area. It stands to reason that if you try to depart without such a document, you should be afforded the same opportunity to show by other means that you are an EU citizen, avoiding any fine that might be imposed for leaving with an Annex II passport that has no entry stamp.
Having said all that, I wouldn't be surprised if some countries or some individual guards would be more difficult in such a situation, and I would try to avoid it if possible. If you cannot, be prepared for the possibility of spending several minutes or even hours clearing immigration controls, especially if your port of exit or entry is not in Germany (where presumably they can look up your Freizügigkeitsbescheinigung in a database).
You also write:
I also happen to have a valid ID of country A which is not a passport as well as a photocopy of my lost document (but I suppose neither will be of help at the border).
Actually, a national ID is all you need to get in and out of the Schengen area. A national ID is an ID that was issued by your country of citizenship for the purpose of identifying you as a citizen. Article 4:
- Without prejudice to the provisions on travel documents applicable to national border controls, all Union citizens with a valid identity card or passport and their family members who are not nationals of a Member State and who hold a valid passport shall have the right to leave the territory of a Member State to travel to another Member State.
Note "identity card or passport."
Again, Article 5:
- Without prejudice to the provisions on travel documents applicable to national border controls, Member States shall grant Union citizens leave to enter their territory with a valid identity card or passport....
Again, note "identity card or passport."
The photocopy of your lost document will help if your ID is not a "national ID" and you have to resort to the alternative means of proof described in the first part of this answer.