According to: this
There's no ActivityInstance
variable predefined, so I assume you have created it yourself and it might be the case that it's not correct. Try using CurrentActivityInstance
instead.
Try this:
(ComponentData)CoreServiceClient.Read(CurrentActivity.WorkItems[0].Subject.IdRef, new ReadOptions());