Instead of a ceiling piston, put the sticky piston in the floor pushing up . Cover it with a fake floor block. When the mob stands on it, trigger the piston to launch a wall around them. This is harder to wire but looks cooler.
Here’s a helpful, straightforward guide to unlocking the achievement in Minecraft (Bedrock Edition), which requires you to build a working piston trap that deals damage to another player or mob. lovely craft piston trap achievement guide