i don't know how you can make a story so amazing... and end it like that...

It is easy; just have the publisher set the release date way in advance of your projected date of completion. Whatever plans you had get replaced by just getting the essential parts finished.

Larian did the final act for Beyond Divinity first, so the ending would not be effected if they ran short of time.