Hi Yasin,
Checked this with our Engineering team. There are some changes needed.
Please use the following API call for toggling ghost mode toolbar item.
// activating
await API.viewer.activateTool("ghostMode");
// de-activating
await API.viewer.activateTool("ghostMode");
Regards
Darshan Kamat