Why does this partitioning helper view give an 'Input string was not in a correct format' error?
The problem lies down in one of the sources used by that view, the system view sys.partition_range_values. The Value column of this view is of type SQL_VARIANT, which can lead to problems with indiscriminate SELECT *s, because SQL has to pick a specific type for the resultset, which all the values then need to be coerced to (Thanks to this blog post for this insight).

You can see for yourself if this is what's causing your problem, by doing

SELECT
    function_id
    , boundary_id
    , parameter_id
    , SQL_VARIANT_PROPERTY(Value, 'BaseType') AS DataType
FROM
    sys.partition_range_values
;


If you have multiple different DataTypes, and you can imagine there might be problems casting values between them, then that's the problem.

To fix, you can update your helper view so that instead of 

prv.value as [boundary_value]


instead you have

CASE SQL_VARIANT_PROPERTY(prv.Value,'BaseType')
WHEN 'datetimeoffset' THEN CAST(CAST(prv.Value AS datetimeoffset) AS varchar(30)) 
WHEN 'smallint' THEN CAST(CAST(prv.Value AS smallint) AS varchar(30)) 
-- etc as necessary for the types used to partition on in your database
ELSE SQL_VARIANT_PROPERTY(prv.Value,'BaseType')
ELSE 'Value of type ' + CAST(SQL_VARIANT_PROPERTY(prv.Value,'BaseType') AS varchar(15))
END 
    AS boundary_Value


This will give you appropriate textual representations of the partition range values.