The police officer probably had a bad day.
Flashing the high beams or using your horn is allowed in two situations: to signal that you will overtake the car in front of you (or have the intention to do so) outside of a built-up area, or if you judge yourself or someone else to be in danger ($16 StVO).
There are some additional provisions about not blinding oncoming traffic, but that shouldn't be a concern on the autobahn. Signaling something that they are driving unsafe and put you in danger is justified by the law.