Assuming that the user will work their way from the top of the screen to the bottom of the screen before hitting the 'Submit' button, it seems unlikely that they will skip mandatory fields that they have to fill in (especially if good field validation practices are in place) by the time they get to the end of the form.
But for argument sake, they skip to the bottom of the page and there are still mandatory fields that are incomplete, there are a couple of strategies you can use to indicate off-screen fields need to be completed.
Firstly, you would need to design an area of the screen that is always visible and used for this type of notification. Typically this is at the top of the screen in a fixed area (e.g. just below the main navigation) even if the page scrolls infinitely, or at the bottom right corner that is overlaid on top of the existing interface (e.g. toast notification that can be dismissed).
Secondly, you have to decide where the focus of the screen is going to be once they have hit the button and the notification is triggered. And you have outlined an example of setting the focus to the first incomplete mandatory field. Or you can simply allow the user to click on the notification relating to the specific errors or fields and use that to send them to the right place.
Finally, you have to decide whether this pattern is going to be consistent with the rest of your notification and error handling interactions, or if you need to adjust it so that it can be consistently applied elsewhere.