[TASK] Simplify error assertion in two functional tests