Sorry, I misspoke. It's still scored because if either set is 4 or 5 cards, it's scored.
You can have a straight on one end and a flush on the other end, and as long as at least 4 cards are in either set, it's still a straight flush. And all cards that work with either set counts in scoring.
It's because the hand joker card there allows straights and flushes to be made with 4 cards, so the 4 black suited cards make a flush, and the gapped sequence makes a straight, since both hands are made together it counts as straight flush. You can ignore the ace. It can get weirder because you can make a 4 card straight and toss another card unrelated but with the same suit as 3 of the straight cards and it still counts as straight flush.