you cant change them directly. When the size of the inventory changes it needs to update a lot of things, that’s what the function handles.
Check the RPCcomponent in your pawn to set the initial size, then, have a look at the function called RPCChangeInventorySize. That should do the trick