I found the answer. I had somehow used typographic single quotes (‘’)
instead straight ones ('')
for the property name. Alternatively it works without quotes as well.
(1) {% set collection = directory.collection.sort({'release_year': 'DESC'}) %}
(2) {% set collection = directory.collection.sort({release_year: 'DESC'}) %}