It doesn't work when you try to use Extract text with OCR and provide a file as the input. When you do that, the file must be an image. But if you extract the text from the foreground window or the entire screen instead of a file, it would work, if you had your PDF file open on the screen.
So, you can use the Run application action and provide the path to the file to this action. This will open the PDF document in your default PDF viewer. And then you should be able to use Extract text with OCR to read the text.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.