Cracking a hash which descends to a single value after repeated hashes
This specific hash function is weak; it appears that what this hash function does is pad out the string to be hashed into a 32 byte string, and then take the 8 4-byte substrings, and maps each substring individually into an individual byte.

This immediately makes it trivial to find a preimage; start with a random 31 byte preimage (there appears to be a bug in the code if it is presented with a 32 byte input), hash it, and for every byte of output that is wrong, modify the corresponding 4-byte substring in the preimage, and repeat until the hash is the expected value.

However, to answer the general question of whether a hash function with the specific property that is necessarily weak, well, I believe that we can produce an example of such a hash function that is not.  One such example would be:


Given the empty string, outputs the empty string
Given a string $S$ of length $L$, generates the first $L-1$ bits of $SHAKE256(S)$


This function would appear to be strong given a long input (because we believe that SHAKE256 is a strong hash function), but repeated application of this hash function eventually will cycle at the empty string.