It's not a bug - Militaristic City States have given UUs since G&K came out.
Each Miiltaristic City State will give you one type of Unique Unit from a Civ that isn't in the game that you are currently playing.
To see which Unique Unit the CS will provide you with, hover over the word 'Militaristic' on the City State's panel.
To get the Unique Unit you must be Allied with the Militaristic City State (being Friends is not enough), you must have any required resources (e.g. Iron for the Samurai or Horses for the Companion Cavalry etc), you must know the Technology that provides the unit and the unit should not be obsolete.
As long as you fulfil all these criteria the Militaristic City State will always gift you the Unique Unit. If you don't meet one or more of the criteria, you will get a random non-unique unit instead.
All City States can grant Unique Great People (Khans, Merchants of Venice) if you have the required Policy from the Patronage tree. This is random though - you won't always get the Unique Great Person and it also does not matter if the Civ that normally gets that unit is in the game (for instance you may still be gifted a Khan when Mongolia is in the current game - or even if you yourself are playing Mongolia).
Hope this helps!