I'm facing the exact same issue - when ran as an SQL Notebook it runs in 40 seconds, the same Notebook as a job on a serverless sql arehouse

There just seems to be gaps of a good number of seconds between each statement when ran as a job.

Severless SQL warehouse takes ~2 minutes.

(I also tried running this on a serverless cluster and it was ~2 minutes, but I can't see the breakdown of statements in the job when I did that)