The information about the parent equation’s size (display, inline, script, sscript) is lost for nested equations when they are wrapped in non-mathy elements such as pad, box or block. This is also visible in @sijo’s reply where the $0$ is shown in the larger inline size instead of the intended script size. You can explicitly set the size though by replacing the it in the clap function with $script(it)$.
See also my reply in Smashoperator Analogue - #4 by Eric for a similarly defined clap function.