It is not a bug.Site Templates does not retain the Security settings.Site templates do not include the following items: Customized permissions, running workflow instances, list item version history, workflow tasks associated with running workflows, people or group field values, taxonomy field values, publishing pages and publishing sites, My Sites, and stapled features.
Please read this Article about Site Templates
Now, if you want to achieve your requirement of breaking inheritance of the Internal document library you will need to write a custom feature(Web Scoped feature) with feature receiver code, which will break inheritance of that document library.