I run into the same symptoms, where the remaining 350 GB of space was consumed in a matter of a few minutes. Consumed by temporary files creates by PostgreSQL.
However, this appeared to be an caused by an infinite loop in our data structure. In a hierarchical structure, where one record, had foreign key referring to a primary key of a record in the same table (in our case an organizational structure). One of the records was pointing to itself, which caused an infinite loop, and also the query to running infinite.
When running in this scenario, the data got nicely cleaned up when shutting down PostgreSQL. My experience is, under normal circumstances, that these file space claimed by PostgreSQL is certainly not that extreme, but it is clearly related to the complexity and size of the data required being queried for.