You will not be able to get the file path of a file field with a return format of URL.
You need to get or return the ID of the file to use the code that you referenced. You can either change the return format of the field to ID or you can get the ID by getting the unformatted value
// https://www.advancedcustomfields.com/resources/get_field/
$id = get_field('file_field_name', false, false);