If a sulfur cube contains any block, attacking it with a weapon with the knockback enchantment will have no different effect to attacking it with something without that enchantment.
To reproduce:
/give @s wooden_sword[enchantments={knockback:5}]
Attack a sulfur cube with a block inside
Attack a sulfur cube without a block inside, or anything else
Note the difference in distance travelled
Expected results would be for knockback to have a clear effect, as is the case with all other entities.
Thank you for helping us improve Minecraft! We saved your files: