Component creation lead info not getting saved


I was trying to create a project component from my plugin. Code is below,

com.atlassian.jira.bc.project.component.ProjectComponent component =ComponentAccessor.getProjectComponentManager().create(“Sample Name”,“Sample description”,
“My Username”, AssigneeTypes.PROJECT_DEFAULT,“projectId”);

The component is getting created under the project specified but lead is not assigned. All other fields are reflected as expected.

My jira version is v7.10.1

When I create from project centric view, I am able to create the component with the required info.

Why the lead is not assigned to the component?