It's currently working in Firefox 70.
archgood https://web.archive.org/web/*/%S
archbad https://web.archive.org/web/*/%s
archgood https://www.google.com/ https://web.archive.org/web/*/https://www.google.com/
archbad https://www.google.com/ https://web.archive.org/web/*/https%3A%2F%2Fwww.google.com%2F
You probably have the wrong URL if you created the search by right clicking the search box and selecting "Add a Keyword for this Search". Firefox records the form's submission URL, but the Wayback Machine intercepts/cancels form submission and redirects to another location with JavaScript instead.
Note that the capital %S only works when you add the search engine via the bookmark editor like this:

Adding it on the settings page only allows you specify a lowercase %s.
%Sno longer works, it is not replaced by the query. Would you know o a new method? – Saaru Lindestøkke Jul 30 '23 at 08:17%Sas a placeholder for the wayback machine, I get a 400 Bad Request when I use it. These are my settings in Firefox and this is what I get when I try to use it. – Saaru Lindestøkke Jul 30 '23 at 16:03