Your first example is not incorrect but it would more usually be expressed as
Because I had to finish the project today, I had to stay late at work.
But that's not because there's anything wrong with using the progressive form of "have to". It's because no matter what the verb is, we usually only use this form to indicate a precondition for a further consequence (i.e., to explain why you had to stay late at work) in very formal writing.
Your second example isn't using the present progressive, but the gerund form of "have to".
In comments you wrote,
Some sources indicate that we cannot use "have to" in the progressive.
It's true we wouldn't normally say something like "I'm having to eat lunch with my mother in law every Tuesday". Instead we'd just say "I have to..."