Bayern Munich say they were surprised by the timing of captain Philipp Lahm's retirement announcement.