Revert "NXP-12493: remove unecessary exception catching in batch automation"

This reverts commit 1d9dedca520d42f6cf5da6ce06e6d218f4ab7ea2.
NXP-12493: Add missing imports