Tankless water heaters do not deliver hot water instantaneously. It takes time to heat the water to the target temperature, and just like storage water heaters, any cold water in the pipes needs to be pushed out.
This is where the problem starts since the front load washers are specifically designed to use little water and even less of hot water. On most newer washers the wash temperatures are much lower than in the past. You won't see hot water only fills in most cycles. Most will bring in cold water and then a little hot to bump the temperature up as needed to the 70 to 100 degrees range of most cycles. The washer will heat the water itself to reach the higher hot wash cycle temperatures.
Very little water, approximately 1 1/2 gallons, is used in each fill and even less of hot water.
This is not a fault of the washer but a limitation of tankless heaters. You may have to consider a single point application tankless heater specifically for the washer.
The washer might be exchanged for a more conventional style that uses 20 gallons of water but then you lose the efficiency of the front load washer.
If you have lots of laundry you wish to wash in very hot water then your choices would be an tankless heater specifically for the washer or a conventional top load washer that will use twice the water.
All modern (newer) front load washers and some top load models of all brands work the same way in controlling water temperature and in the amount of water used.
Each fill is only 1 1/2 gallons of water total so depending on where the heater is located and how far from the washer you will have the problem you describe.
Most likely exchanging the washer will not help with this problem.