What to do on a desk reject of a revised paper? Since this is a longer story, let me first give some background:

We submitted a publication to a journal in the field of engineering. The article remained on the status “with editor” for more than two months. Our inquiries with the editor-in-chief and through the publisher’s contact form were not answered. When we contacted the assistant editor, things got moving and we got a “major revision” with rather positive, but brief comments from two reviewers. The editor-in-chief handled the manuscript. We addressed all of the comments very carefully and resubmitted.

The next day we received a desk reject from the editor-in-chief as the handling editor. They said our article was out of scope and had a lack of novelty. Both of these issues have not been mentioned by the previous decision letter or the reviewers’ comments. On the contrary, one of the reviewers specifically commented that the paper was on scope in this journal and the results would be useful for researchers and practitioners. 

The journal does not have a formal way to appeal, and the author guidelines state that editor decisions are final. The editor-in-chief did not react to our request to clarify how our manuscript could have become worse, i.e. out of scope, after the revision. Due to a number of constraints, it is difficult for us to go to another journal.

If we would have gotten a desk reject on the initial submission in a useful delay, I would have accepted the decision. But I find it unprofessional to reject a revised manuscript on those grounds.

Given these circumstances, how should we proceed?
Something out of the ordinary clearly happened. It's not professional to reject a paper as being out of scope after it's been revised. My speculative guess is that the editor-in-chief is not very active, and the assistant editor was trying to keep things moving on her own initiative. The letters you received might well be automated emails with automated signatures by the editor-in-chief, i.e. the EiC didn't actually handle your manuscript. However this is pure speculation, and can be completely wrong.

Suggestions on what to do now: if you received a personalized letter from the editor-in-chief saying your paper is out of scope, don't bother appealing the decision and submit it elsewhere. Otherwise, you can write back to the journal to check if there was a mistake, pointing out that one of the reviewers did, after all, say your paper was within scope + useful to the field. I would not be very hopeful, but it's an option.