No, this is not a myth. The case of an attack by motorized units by cavalry did take place in 1939 during the Polish company of the Wehrmacht. The battle took place on September 1, 1939 near Kroyants.
Polish troops were thrown into battle against the 76th Infantry Regiment from the 20th Motorized Wehrmacht Division, which operated on the left flank of the 19th Panzer Corps under the command of Heinz Guderian. The Polish cavalry tried with all its might to delay the German advance on Gdansk, but the defense was broken. The 18th Pomeranian Uhlan regiment was supposed to gain time and cover the retreat of units deep into the rear.
The 18th Uhlan regiment clashed with a detachment of German infantry on the plain near Tucholski Bor and the intersection on the Chojnice-Runovo railway. Colonel Kazimir Mastalezh ordered the commander of the 1st squadron, Eugeniusz Svischak, to prepare an ambush and attack with two squadrons at 19:00. The attack was initially successful as the Germans dispersed and the Poles occupied the plain. However, armored vehicles from the 20th reconnaissance detachment came to the aid of the Germans, as a result, the Poles lost half of their personnel, including Mastalezh and Svishchak died, but the Germans were forced to temporarily stop the offensive.
On the same day, German war correspondents and their Italian colleagues explored the battlefield. The Italian journalist Indro Montanelli set about writing an article about the battle and wrote about the courage and heroism of the Polish soldiers who rushed at the German tanks with sabers and pikes. Although nothing like this happened in reality, this fiction began to spread at a rapid rate: in the German magazine "Die Wehrmacht" on September 13, it was noted that the Polish forces seriously underestimated the power of the German army, since they climbed onto tanks with medieval weapons.
Be that as it may, for the successful operation of the 18th regiment, by order of General Stanislav Grzhmot-Skotnitsky, was awarded the Order of Virtuti Militari for bravery in battle.