Thanks again for more advice. The 40 gal is temporary, definitely not meant to be the final home. It's got tons of room for now, will move into at least a 75 gal once it's grown a bit larger. I dimmed the lights a few days ago, with no change in behavior. The fish has eaten a little bit, just a few floating cichlid pellets, and ignores most of them. Doesn't seem all that interested in having a look. Swims occasionally, mostly now just hiding beneath the root-structure decoration I added to help it feel secure. May remove that soon, it's reduced the fish's activity for sure. Will look for blackworm sticks to try.
I really appreciate all the comments on tank size, water quality, temperature, and the like. The thing that's puzzling me is why this fish is behaving so differently from all the others--particularly the cichlids--that I've had in the same tank, with the same water and filtration, over the years. I've kept fish, including a few oscars, for more than 30 years, so I've learned all the rookie mistakes the hard way in the past! This fish behaved nicely in the store but sulks in my tank. It's now been 13 days since I brought it home, with no significant change in behavior despite the few things I've tried. If it goes much longer without eating well, I may try to rehome it before health problems develop.