The ID is always in upper case and only this should be accepted by the factory. The use of lower-case letters was an initial error in Wikibase that got fixed. So your code is perfectly correct now (and this will be our permanent solution).