Hi @Winterkid,
I tested the api you provide, and found the issue you met, if generate via it, the url will direct to the main page of SharePoint, I guess it is caused by the api.
I tested generate the QR code via Google or Encodian, but not find the same issue, for example:

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.