Q … how much of it is based on actual events?
…is quite a broad inquiry. This answer concentrates solely on the two concrete events depicted, as OP said, "these are ones I am curious about", which seems answerable.
The phosgene subplot – as such – is plausible. Planning for the next war started before World War I was over. Just like with tanks and planes the German right-wing military broke the Treaty of Versailles immediately and soon started to cooperate with the Soviet Union to develop and manufacture poison gas to be used on battle fields. Manufacturing within Germany continued in parallel with so-called disarmament and remediation of stockpiles. These Soviet supplies would have doubled Germany's capacity to wage gas warfare. Some details seem to be twisted for dramatic effect and outright invented in the series, but one such phosgene accident and explosion for example did kill 10 Hamburgers.
As the character of the police official is only loosely based on a real person that sub-plot is mostly invented. Although false flag operations weren't uncommon in Weimar times. Most prominently at the beginning, with Feme-murders among right-wingers blamed on communist conspirators or later with burning down the Reichstag building and conveniently apprehending and blaming a communist scapegoat.
Phosgene, and other poison gas plotting
An analysis of the plans drawn up between 1919 and 1945 and the preparations made for an offensive German gas warfare reveals a hubris of military thinking which, together with private-sector interests, was aimed at creating a promising instrument for the renewed "grip on the world power". Based on the concept of total war, a group of military specialists was obviously determined to put the most radical form of industrial warfare at the service of an aggressive striving for power, which - measured against conventional means of warfare - seemed to promise the greatest possible destruction value with the least possible personal and material commitment.
The outbreak of the Ruhr crisis with the accompanying intensified war preparations of the Reichswehr made Stoltzenberg a sought-after partner of the military. At a meeting with representatives of the Army Weapons Office (H.Wa.A.) on 26.127. January 1923, he first pointed out the possibility of reactivating the remaining stocks of the First World War still stored in Breloh9. There were at least 400,000 kg of phenylarsic acid and diphenylarsic acid to be burned by the civilian Reich trust agency at the instigation of the Allied control authority, as well as 28,000 smaller phosgene bottles for blast attacks and about 300,000 bottles with a blue cross for artillery ammunition. Both sides agreed that the destruction of this material had to be prevented at all costs. Stoltzenberg also offered his factory in Hamburg, which was under construction, to supply 6 t green cross and 6 t yellow cross three months after the order was placed and 6 t blue cross daily after six months. However, the Reich was to pay him for the equipment and provide the necessary raw materials. H.Wa.A. then made an effort to support the purchase of arsenic mines in the Caucasus, Turkey, Spain, Chile and China, arsenic smelters in Russia and Spain as well as sulphur mines in Turkey and Chile. For the construction of a phosgene and lost factory, the Reich Ministry of Defence provided a total of more than 20 million gold marks10. Because Stolzenberg's factory in Hamburg was considered to be at risk from air attacks, a new building was built in Gräfenhainichen near Halle11.
Since neither a breach of secrecy nor a possible Allied advance to Central Germany could be ruled out, additional contacts were made with the Soviet Russian government in the summer of 1923 in order to create a war potential with the relocation of German testing and production of warfare agents to Soviet Russia, which would have been beyond the Entente's possibilities of intervention12. The conditions for this were extremely favourable.
At both the political and economic levels, Moscow had already expressed its urgent interest in expanding German-Russian relations. The conclusion of the Rapallo Treaty provided a suitable basis for this. In addition, the Red Army's gas combat preparations had already made considerable progress. Four gas combat inspections had been formed and a gas training area had been set up in the Moscow military district13.
On Trotsky's initiative, the "Society of Friends of Chemical National Defence" (Dobrochim) was formed, which trained more than a million volunteers to support gas warfare and gas defence. In feverish haste, several factories for the production of warfare agents had been prepared in order to be prepared for Western intervention tendencies. Practical experiments were carried out on some prisoners, which the G.P.U. provided. At the Dobrochim meetings, Trotsky raged about the pacifist tendencies in the Western world and called for "to unite German technology with our natural resources, thereby enriching the German people and helping us to climb the ladder of our economic construction more quickly "14.[…]
The German workers travelled in small groups via Riga and Moscow to Trock. Their pay was above average, but working conditions, isolation and intimidation were severe. For medical care, the Gefu commanded two staff doctors of the Reichswehr to Trock17. During frequent visits, members of the liaison staff of the Reichswehr in Moscow were able to convince themselves of the progress of the work led by Stoltzenberg. The main focus was on the construction of special machines for the production of phosgene and lottery tickets for more than one million grenades. This would have enabled the Reichswehr to more than double its stock of legal, conventional artillery ammunition with poison gas grenades manufactured in Russia. Since in the 1920s the warfare agent activities of the major Western powers came to a virtual standstill due to the continuing worldwide ostracism of the chemical war18, the German military seemed in this way to be able to compensate for its conventional inferiority. In military journalism, a broad discussion of the strategic and tactical applications of warfare agents, which were judged to be positive, was therefore unanimous since 1925.
At the political level, efforts by the US government had led to the conclusion of the Geneva Gas Protocol on 17 June 1925, in which Germany also undertook to refrain from preparing and conducting a chemical war. However, the dependence of the Weimar Republic on the victorious powers, which was carried out with the Locarno Treaties and the accession to the League of Nations, as well as the official declarations of the German Foreign Minister Stresemann, who was awarded the Nobel Peace Prize, stood in clear contrast to the secret armament measures of the Reichswehr, which were approved by all Weimar cabinets despite certain restrictions20. However, the Russian project had very quickly got into difficulties due to Stoltzenberg's inadequate work and a freak of nature. A spring flood of the Volga had flooded Stoltzenberg's factory for weeks at the beginning of 1926 and created the danger that the poison gas already produced would be released. After the machines had been meagerly repaired, negotiations for a new start-up were initiated. Due to considerable technical difficulties, the plant had so far only been able to produce two tons of phosgene. It had neither been accepted by the Gefu nor by the competent Russian Commission. The Russians, however, now endeavoured to take the reconstruction into their own hands and to involve the Reichswehr only as a financier and customer. They described Stoltzenberg as a fraud and denounced him for financial irregularities in the Reichswehr.
In the meantime, however, Stoltzenberg's position had also begun to falter in Germany. In March 1925, the chemical industry had protested against Stoltzenberg's production of chlorine in a "factory largely subsidized by the state" despite a general surplus of chlorine in the Reich. It therefore refused to continue supplying Stoltzenberg with raw materials and intermediate products21. However, it was not just a question of eliminating an annoying competitor. Rather, the focus was on the well-founded fear that the uncovering of the illegal production of warfare agents or their preparation for production could endanger the position of the German chemical industry on the important export markets and provoke renewed intervention by the victorious powers in German chemical production.
On the other hand, since the cessation of the Ruhr War the Reichswehr could no longer dispose of the same amount of financial resources as before, so that the question arose as to whether these should be used primarily for the undoubtedly risky enterprise in Russia or to build up its own German armaments capacity. Stoltzenberg himself had spent money on his engagement in Russia. When the Reichswehr refused to support Stoltzenberg even in the Foreign Office22, he was threatened with bankruptcy. The plant in Trock then took over and handed it over to the Russians, who tried in vain to obtain the equipment necessary for further expansion from the German chemical industry. Only after lengthy negotiations did medium-sized manufacturers find themselves at inflated prices.
Stoltzenberg's facilities in Germany were also placed under business supervision by H. Wa.A. as part of an out-of-court settlement. After Stoltzenberg's activities in Russia had become known at the end of 1926 through a major press campaign and had contributed to the overthrow of the Mar* government, Stoltzenberg finally retired as a manufacturer from the military's plans. However, the solution to this connection did not go smoothly. On December 2, 1926, the H.Wa.A. had determined that Stoltzenberg was still depositing 8,000 phosgene bottles that he wanted to sell to the USA in the Sennelager23. They were in such a precarious condition that H.Wa.A. was afraid of "serious accidents" and claims for damages. "Since the Stoltzenberg company is not financially efficient," H.Wa.A. suspected, "the injured parties claiming damages will approach us safely, also in view of the fact that we had previously stored the warfare agent in a prohibited manner."24 With the order to first refill the gas cylinders into safe containers in the alpine dairy warehouse and only then to transport them away, the military believed they could discharge their responsibility. When two of the large containers brought from Stoltzenberg to Hamburg exploded on 20 May 1928, at least ten people were killed. The Reichswehr, however, succeeded in averting the foreseeable damages suit in a lengthy procedure.
Even before the Stoltzenberg affair was over, the H.Wa.A. concentrated on putting the testing and production of warfare agents in Germany on a new footing. At a meeting on January 11, 1924 in the Army Command Staff, the company Heyden in Radebeul (Phosgene) and the Agfax company (Blaukreuz) were included in the planning in addition to the plants planned by Stoltzenberg25. In addition, it was also considered to procure a mob stock of Lost, which would cover the demand until the start of the prepared production. Since the production of large quantities of warfare agents in Germany could not currently be risked, the Reichswehr wanted to participate in the construction of a Hungarian warfare agent factory in Stuhlweißenburg and secure half of the production for Germany. At a further meeting in the Truppenamt on 15 December 1925, this armament strategy in the field of chemical weapons was once again expressly confirmed. It was therefore necessary to create a domestic manufacturing base at least for Lost, which would be sufficient, together with the mob supplies and "with the available foreign production [!], to cover the foreseeable large demand for gas troops, airplanes, artillery etc. on an ongoing basis". For this reason, the production of warfare agents in small plants should already be developed in such a way as to ensure that large plants can be set up quickly and smoothly if necessary26. An inventory of the supply rod in H.Wa.A., however, revealed relentlessly that the conditions for this program were conceivably bad: "While all larger states are preparing for the chemical war, in Germany all plants and germ cells for the production of war gases have been destroyed or dispersed.27 In the protected inner part of Germany only the small company of Heyden, which could supply a maximum of 2 tons of phosgene per day, was now ready for operation.
The collapse of the Stoltzenberg companies thus made a reorganization of the German gas combat preparations unavoidable.
Rolf-Dieter Müller: "Die deutschen Gaskriegsvorbereitungen 1919—1945. Mit Giftgas zur Weltmacht?", Militärgeschichtliche Zeitschrift, Vol 27, No 1, 1980 DOI
From the above you can see where and how the series was accurate and what they made up. Absence of knowledge from not watching the series might be compensated by not reading just Wikipedia on Stoltzenberg. The history on this from what's available in most online sources is murky. But by comparing Györgyi Vásárhelyi, László Földi: "History of Russia’s chemical weapons", AARMS, Vol. 6, No. 1 (2007) 135–146 (PDF). And Benjamin C. Garrett, John Hart: "The A to Z of Nuclear, Biological and Chemical Warfare", Scarecrow Press, 2009. (Bersol).
In "Tomka" we find that what one account described as failure and scrapped by 1927 is quite misleading as that new site operated from 1928–1933 (well, and afterwards, but the German element left).
Assassination plot on chief of police
This is much more fictionalised.
The character of August Benda, high police official is based on Bernhard Weiß (police executive).
The figure of the republican head of the political department was designed in the style of Dr. Bernhard Weiß, deputy Berlin police president since 1927. As one of the few Republican-minded senior police officers, Weiß systematically intervened against violations of the law and thus became the victim of regular defamation campaigns by the emerging NSDAP. He has been replaced in the series by Matthias Brandt's character, who has a lot in common with Bernhard Weiß (origin, war past, preference for the arts). The reason for this shift is simple: at the end of the second season, the serial character falls victim to an assassination attempt, while Bernhard Weiß is deposed in the so-called Prussian strike of 1932, but was able to flee to England after the Nazis seized power.
Wikia: August Benda