My guess is that, for whatever reason, he could not find a suitable place to make a pupal cell in his enclosure, and is probably going to pupate right there at the top of the substrate. I would flatten out and smooth the top of the substrate, make a indentation in the center like a pupal cell and put it in there, and see what happens. (Disclaimer, I've never kept these types of beetles so this may be horrible advice, this is what I do for certain Tenebrionids that attempt to pupate on the surface though)