LPS-40027 Fixing problems when importing an entity that is trashed

reviewed by @KocsisDaniel