MULE-7883: Reverting schema rewrite line that was causing trouble. Adding test to cover scenario.
(cherry picked from commit 65ae25a8c2a799853bd8271e52894d2d0edc18f7)