Doorframe gap - temporary fix?
It is not an error to have a gap, It is an error that the job was not finished properly. 

The gap or space in not unusual. the opening ( rough opening ) is always larger then the door jam so that the door can positioned inside the opening plumb and true ( square ). 

The gap is supposed to be filled with insulation of some kind. Typically  this is a spray foam product in a can. You can do this your self, You must use a spray foam called minimally expanding window and door spray foam insulation. 

You should mask off the wall and the jam with painters tape so if you spray to much in and it expands outside of the gap and onto the wall/jam it will not stick to the jam or wall. ( it is tenacious stuff and not easy to remove and will leave a stain ) once dried you can trim any excess off with a knife. ( an old serrated bread knife works well for this, and then remove the painter tape. You do not fill the whole void as the foam will expand two to three times its volume. I am sure if you do  YouTube search for how to spray foam a door jam you will get plenty of instructions. 

The door trim is then installed and this will hide the gap/insulation.