You cannot customize the details pane using Power Apps, you can only customize the "Properties" forms of document library.
Here's what you can do in SharePoint online:
A. Disable editing of metadata from details pane and quick edit from library settings.
B. Customize Properties form using Power Apps and use below steps to open the form:
- Go to SharePoint library
- Select one document
- Click on Properties from command bar at the top or from context menu (...)
For more information, check my answer at: Make properties not modifiable in SharePoint library with PowerApps
If you want to open Properties form directly from library view, you can use JSON formatting with
editProps row action.
Documentation: JSON formatting - CustomRowAction