so I removed the specific part that was asking for libraries and posted it again the next day.
The second time: I immediately got flagged for asking the same question.
You need to edit the original question, not post a second one. People sometimes do that to dodge the reasons why a question got closed, so it is frowned upon. Plus it also creates a bunch of duplicates about the same thing.
Why wasn't it flagged for "needs more focus" the first time?
When closing a post we can only pick one reason, even if there are multiple problems with a question. Sometimes different close voters pick different reasons, which one that gets displayed when the question gets closed is as per majority vote - so if two people voted "duplicate" and one voted "too broad", it will get closed with the reason of being a duplicate. But the close vote of the person who voted "too broad" still counts.
Why did I have to post it 2 times just to find that out?
One can start by reading https://stackoverflow.com/help, the "Asking" part in particular, before asking the first question. A few of these things are also covered by the new user tour: https://stackoverflow.com/tour
And is there any chance the question will be opened up again?
It currently has two reopen votes by reviewers, it needs 3, so it seems likely. There is also a delete vote for some reason. I know too little of the topic to tell if the close, reopen or delete votes are justified or not.
I changed the whole text and there is no notification or similar of anybody looking over it again. Will I have to submit it again tomorrow or is editing a closed question the same as reposting it?
Whenever you edit a closed post, it ends up in a review queue for "reopen reviews", which means that a number of veteran users will take a look at it and vote to reopen or leave closed, if they think that the edit solved all problems with the question or not.
Therefore, editing a closed question is the preferred way, since that's how you can get it reviewed and re-opened. Questions are closed rather than deleted for one reason: to give the question a chance to get edited into shape and re-opened.
You should absolutely not post a new question with the same contents, as that will be regarded as trying to dodge the reasons that your question got closed to begin with.
Please note that posting multiple poorly-received questions, to the point where a majority of your questions were poorly-received, will count towards a question ban from using the site, regardless if you delete them or not! Deleted questions are still stored, just not visible, and will count towards such a ban. This is an automatic process by site mechanics that can't be reversed by moderators.