[loader] Move test failure handling to _insert