The “Temp” class does NOT have an item granter, Because on Temp2 Line 21 you are making a new instance of the Temp class which means the editable is irrelevant.
Try adding the @editable Item Granter to temp2 while keeping the item_granter_device (and removing the @editable from temp) and replace line 21 with
T:temp=temp{ItemGranter:=ItemGranterDeviceReference}
also there’s no need for Temp class to be of (creative_device)