How can I change the published state of a node before it is saved with hook_entity_presave()?
I have tested with hook_entity_presave() and setPublished(0) and setPublished(FALSE) both worked.  So the issue is somewhere else.

If you have workbench moderation installed, you may need to set it to one of your moderation states that set it to unpublished.

See admin/structure/workbench-moderation/states

$entity-&gt;set('moderation_state', 'draft');


or

$entity-&gt;set('moderation_state', 'unpublished');


or perhaps a custom moderation state.