@Nabeelshakil
You should re-check this line from your code:
It can’t work in the custom liquid block because the value can’t be taken.