Merge branch 'fix/unreachable_codes_due_to_wrong_assert_position' into 'master'

Resolve "Two unreachable code sections"

Closes #1030

See merge request !2609

(cherry picked from commit d3f97928)

0c533588 [bugfix] Fix the assert position
4 jobs for !2611 with cherry-pick-d3f97928
latest merge request