Difference between disabling the plugin from Jira and Atlassian SDK

I have tried 2 methods of disabling the plugin:

ComponentAccessor.getPluginAccessor().getPlugin(plugin-key).disable();

and

ComponentAccessor.getPluginController().disablePlugin(plugin-key);

Both of them are not disabling the plugin as the disable button of Jira Manage add-ons. Plugin is still working when disabling from SDK, even if it looks as disabled, but in Jira it disables correctly.

Is there a proper way of disabling the plugin?