Let's look at the big picture, here. It may not be your fault, but it sounds like you do not match their expectations of you. If that's true, then the only thing worse than staying would be to get another job which has the similar expectations.
"Since for 8 months no one would assign me any work..."
For whatever reason, you have not been able to meet the company's needs for 8 months. Perhaps your hiring manager misunderstood your level of experience. Perhaps you misunderstood their expectations. Interviewing is hard, and we all get it wrong.
It sounds like they were hoping you would show more initiative, since they did not prepare someone to train you 8 months ago. In fact, it may be that all of the people who are qualified to train you are already stretched thin within their own roles.
"... except for easy scripts or stupid impossible tasks like "Make a program that lets me speak to Microsoft Word".
The folks assigning work to you may not be qualified to do your job. They may not even be qualified to know exactly what your job is, or what the difference is between a small script and voice recognition software.
If that is the case, they were hoping that you were fully equipped to carry out that role on your own, without support from a more senior developer; or perhaps that you would seek and find your own mentorship within the company. In other words, these people view your professional development as your problem to solve; they need you to be ready to meet their needs right away.
"... we started a much more intensive training program to get me up to speed..."
So now, you have been assigned a PM, who is likely working extra hours to get his/her primary job done. That person is covering for your mistakes. He does not care if it was your fault or not. He does not care if you must do homework, because your job is now his homework. His success in his role is now tied (at least partially) to you. His priority is to make sure he does nothing wrong so that he will not be blamed if you fail.
This PM could look bad by giving you leniency, because (ostensibly) the PM's job is to get you ready to meet the company's expectations. In reality, I've heard that a PIP is often a formality, to make sure they do not get sued when they fire you.
Be careful how much you push back. Charging the company for the hours you spend outside of work sounds reasonable to me. However, know that if you push back too much, you are already very close to being fired. That will give you more time to focus on your job search. Do you have enough in savings to survive for a few weeks or months?
I would look for a job which has more opportunity to train you. A recruiter can help you find a good fit. My first employer did not emphasize experience, and would take anyone who said they were willing to learn to program. My boss was also a software developer (the position I was hired for), and he would feed me any task in three or four pieces if I could not grasp the big picture myself. Also, because he was a developer, he knew exactly how much I should be able to accomplish in my first week, and did not overwhelm me. He spent time finding the perfect tasks for me to get started on, so I could train by developing code to go into the product.
That was a lot of extra work for my boss! He was willing to do all that because he could not afford to reward someone for experience. He had a limited budget, and the company had a policy of hiring on one-year contracts: no full-time employees. Before hiring me, he had just lost or let go everyone in my role, and I was the first of three replacements he had hired. I had no future there, but it was a great place to start out.
My second job required me to display a lot more initiative. I was not ready for it, and nearly got fired in the first year. Someone else covered my mistakes, and I adapted. This experience is part of your adaptation. I'm sorry that the job is not working out, but it will be an important step to build your future. Hang in there!