Referring to https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#empty, empty
function can't be used on types other than String, Array, or Object. Though numbers are typed as Float, Integer or any number types which is also an object in dotnet, the term "Object" here refers to an entirely JSON object. So, that's probably the reason why it's error.
So you might need to change your expression to if(equals(items('Apply_to_each')?['Noofassignments'],null),1,add(items('Apply_to_each')?['Noofassignments'],1))
.
Hope that helps.