dnd 5e – Can Transmute Rock to Mud be cast on both ceiling and floor if they are within 40 feet of each other?

The level 5 spell Transmute Rock of Wizards and Druid can be used to Transmute Rock to Mud:

You choose an area of stone or mud that you can see that fits within a 40-foot cube and is within range, and choose one of the following effects.

Transmute Rock to Mud. Nonmagical rock of any sort in the area becomes an equal volume of thick, flowing mud that remains for the spell’s duration.

The ground in the spell’s area becomes muddy enough that creatures can sink into it. Each foot that a creature moves through the mud costs 4 feet of movement, and any creature on the ground when you cast the spell must make a Strength saving throw. A creature must also make the saving throw when it moves into the area for the first time on a turn or ends its turn there. On a failed save, a creature sinks into the mud and is restrained, though it can use an action to end the restrained condition on itself by pulling itself free of the mud.

If you cast the spell on a ceiling, the mud falls. Any creature under the mud when it falls must make a Dexterity saving throw. A creature takes 4d8 bludgeoning damage on a failed save, or half as much damage on a successful one.

If the ceiling is less than 40 feet high, can Transmute Rock be cast on both floor and ceiling at the same time, to get both effects from a single casting?