Hi there, I can reproduce what you are seeing. This should work, but it looks like a bug in our API. I suggest you log a ticket with Esri support. They can get a bug logged with your account attached to it for tracking purposes.
Hi Girishchandra, here's a link to contact technical support: Esri Support Contact Support.
If you are U.S. based, contact Esri Support directly. If international, contact your Esri Distributor and log a support case with them.