# Buggy code
def pixel_to_world(self, x: u.pixel, y: u.pixel, origin=0):
    """
    Convert a pixel coordinate to a data (world) coordinate by using
    `~astropy.wcs.WCS.wcs_pix2world`.

    Parameters
    ----------

    x : `~astropy.units.Quantity`
        Pixel coordinate of the CTYPE1 axis. (Normally solar-x).

    y : `~astropy.units.Quantity`
        Pixel coordinate of the CTYPE2 axis. (Normally solar-y).

    origin : int
        Origin of the top-left corner. i.e. count from 0 or 1.
        Normally, origin should be 0 when passing numpy indices, or 1 if
        passing values from FITS header or map attributes.
        See `~astropy.wcs.WCS.wcs_pix2world` for more information.

    Returns
    -------

    coord : `astropy.coordinates.SkyCoord`
        A coordinate object representing the output coordinate.

    """

    # Hold the WCS instance here so we can inspect the output units after
    # the pix2world call
    temp_wcs = self.wcs

    x, y = temp_wcs.wcs_pix2world(x, y, origin)

    out_units = list(map(u.Unit, temp_wcs.wcs.cunit))

    x = u.Quantity(x, out_units[0])
    y = u.Quantity(y, out_units[1])

    return SkyCoord(x, y, frame=self.coordinate_frame)


# Traceback (ValueError)
Traceback (most recent call last):
File "/Users/dstansby/github/sunpy/test.py", line 27, in <module>
print(m.bottom_left_coord)
File "/Users/dstansby/github/sunpy/sunpy/map/mapbase.py", line 719, in bottom_left_coord
return self.pixel_to_world(0*u.pix, 0*u.pix)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.9/site-packages/astropy/units/decorators.py", line 251, in wrapper
return_ = wrapped_function(*func_args, **func_kwargs)
File "/Users/dstansby/github/sunpy/sunpy/map/mapbase.py", line 1146, in pixel_to_world
return SkyCoord(x, y, frame=self.coordinate_frame)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.9/site-packages/astropy/coordinates/sky_coordinate.py", line 314, in __init__
skycoord_kwargs, components, info = _parse_coordinate_data(
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.9/site-packages/astropy/coordinates/sky_coordinate_parsers.py", line 301, in _parse_coordinate_data
_components[frame_attr_name] = attr_class(arg, unit=unit)
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.9/site-packages/astropy/coordinates/angles.py", line 536, in __new__
self._validate_angles()
File "/Users/dstansby/miniconda3/envs/dev/lib/python3.9/site-packages/astropy/coordinates/angles.py", line 557, in _validate_angles
raise ValueError('Latitude angle(s) must be within -90 deg <= angle <= 90 deg, '
ValueError: Latitude angle(s) must be within -90 deg <= angle <= 90 deg, got 359.9997222222222 deg

# Fixed code
def pixel_to_world(self, x: u.pixel, y: u.pixel, origin=None):
    """
    Convert a pixel coordinate to a data (world) coordinate.

    Parameters
    ----------
    x : `~astropy.units.Quantity`
        Pixel coordinate of the CTYPE1 axis. (Normally solar-x).

    y : `~astropy.units.Quantity`
        Pixel coordinate of the CTYPE2 axis. (Normally solar-y).

    origin : int
        Deprecated.

        Origin of the top-left corner. i.e. count from 0 or 1.
        Normally, origin should be 0 when passing numpy indices, or 1 if
        passing values from FITS header or map attributes.

    Returns
    -------
    coord : `astropy.coordinates.SkyCoord`
        A coordinate object representing the output coordinate.
    """
    self._check_origin(origin)
    if origin == 1:
        x = x - 1 * u.pixel
        y = y - 1 * u.pixel

    return self.wcs.pixel_to_world(x, y)