Rental items are supposed to be standalone equipments, this is why you're experiencing these issues.
Just look at what your inventory table is (or another table that manages items, actually):
CREATE TABLE IF NOT EXISTS `inventory` ( `id` int(11) unsigned NOT NULL auto_increment, `char_id` int(11) unsigned NOT NULL default '0', `nameid` int(11) unsigned NOT NULL default '0', `amount` int(11) unsigned NOT NULL default '0', `equip` int(11) unsigned NOT NULL default '0', `identify` smallint(6) NOT NULL default '0', `refine` tinyint(3) unsigned NOT NULL default '0', `attribute` tinyint(4) unsigned NOT NULL default '0', `card0` smallint(11) NOT NULL default '0', `card1` smallint(11) NOT NULL default '0', `card2` smallint(11) NOT NULL default '0', `card3` smallint(11) NOT NULL default '0', `expire_time` int(11) unsigned NOT NULL default '0', `favorite` tinyint(3) unsigned NOT NULL default '0', `bound` tinyint(1) unsigned NOT NULL default '0', `unique_id` bigint(20) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `char_id` (`char_id`)) ENGINE=MyISAM;
nameid is the item ID# of that particular item and expire_time is the time at which the item expires. So, if you compound a card onto an item, all the entry information for the card is deleted and the equipment info is updated with the card inserted on its correct slot, making the expire_time of the card nowhere to be found, thus rendering it permanent.
A polite guess (not sure) is that if you rent slotted equipment and insert permanent cards on it, they should be lost once the rental time expires
.
P.S.: This is not a script concern, moving to General support section
.