When using setEncryptionName, the first parameter is equal to the entry name of the file you added.
In case you set an explicit entry name with the second parameters of the addFile method, then you need to use that entry name.
Using the first parameter of addFile will only work in case the second parameter is not used.
This works :
$zip->addFile('test.txt', 'my_awesome_textfile.txt');
$zip->setEncryptionName('my_awesome_textfile.txt', ZipArchive::EM_AES_256);
This does not work and will generate an archive without any encryption :
$zip->addFile('test.txt', 'my_awesome_textfile.txt');
$zip->setEncryptionName('text.txt', ZipArchive::EM_AES_256);