Volatile carbon locking and release in protoplanetary disks. A study of TW Hya and HD 100546